exo-jcr SVN: r5427 - in jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: clean/rdbms and 5 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-06 04:44:12 -0500 (Fri, 06 Jan 2012)
New Revision: 5427
Removed:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBRestore.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleaner.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java
Log:
EXOJCR-968: Move DBInitalizer and DBCleaner common code into separated class
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -19,7 +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.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.backup.BackupException;
@@ -114,7 +114,7 @@
catch (SQLException e)
{
exc = e;
- throw new BackupException("SQL Exception: " + ExceptionManagementHelper.getFullSQLExceptionMessage(e), e);
+ throw new BackupException("SQL Exception: " + JDBCUtils.getFullMessage(e), e);
}
finally
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBRestore.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBRestore.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBRestore.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -20,7 +20,8 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
-import org.exoplatform.services.database.utils.ExceptionManagementHelper;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
@@ -31,7 +32,6 @@
import org.exoplatform.services.jcr.impl.clean.rdbms.DBCleaner;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectZipReaderImpl;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.log.ExoLogger;
@@ -184,7 +184,7 @@
}
catch (SQLException e)
{
- throw new BackupException("SQL Exception: " + ExceptionManagementHelper.getFullSQLExceptionMessage(e), e);
+ throw new BackupException("SQL Exception: " + JDBCUtils.getFullMessage(e), e);
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -16,13 +16,16 @@
*/
package org.exoplatform.services.jcr.impl.clean.rdbms;
+import org.exoplatform.commons.utils.IOUtil;
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerHelper;
import org.exoplatform.services.log.ExoLogger;
@@ -772,7 +775,7 @@
String script;
try
{
- script = DBInitializerHelper.readScriptResource(scriptsPath);
+ script = IOUtil.getStreamContentAsString(PrivilegedFileHelper.getResourceAsStream(scriptsPath));
}
catch (IOException e)
{
@@ -780,12 +783,12 @@
}
List<String> scripts = new ArrayList<String>();
- for (String query : DBInitializerHelper.scripts(script))
+ for (String query : JDBCUtils.splitWithSQLDelimiter(script))
{
// Skip creation JCR_S(M)CONTAINER TABLE
if (!query.contains("CREATE TABLE JCR_" + multiDb + "CONTAINER"))
{
- scripts.add(DBInitializerHelper.cleanWhitespaces(query));
+ scripts.add(JDBCUtils.cleanWhitespaces(query));
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleaner.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleaner.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleaner.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -17,8 +17,8 @@
package org.exoplatform.services.jcr.impl.clean.rdbms;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
-import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -188,7 +188,7 @@
{
for (String scr : scripts)
{
- String sql = DBInitializerHelper.cleanWhitespaces(scr.trim());
+ String sql = JDBCUtils.cleanWhitespaces(scr.trim());
if (sql.length() > 0)
{
if (LOG.isDebugEnabled())
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -20,11 +20,11 @@
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.ConfigurationPersister;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
-import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCUtils;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -22,6 +22,7 @@
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
+import org.exoplatform.services.database.utils.DialectDetecter;
import org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
@@ -31,7 +32,6 @@
import org.exoplatform.services.jcr.impl.core.lock.cacheable.LockData;
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory.CacheType;
import org.exoplatform.services.jcr.jbosscache.PrivilegedJBossCacheHelper;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.core.lock.jbosscache;
-import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCUtils;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.loader.AdjListJDBCCacheLoaderConfig;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -18,14 +18,15 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc;
+import org.exoplatform.services.database.utils.DialectConstants;
+
/**
* Created by The eXo Platform SAS.
*
* @author Gennady Azarenkov
* @version $Id: DBConstants.java 34801 2009-07-31 15:44:50Z dkatayev $
*/
-
-public class DBConstants
+public class DBConstants extends DialectConstants
{
// ======================== Error constants ========================
/**
@@ -261,98 +262,4 @@
*/
protected static final String COLUMN_VSTORAGE_DESC = "STORAGE_DESC";
- // Dialects
- /**
- * DB_DIALECT_AUTO.
- */
- public final static String DB_DIALECT_AUTO = "Auto".intern();
-
- /**
- * DB_DIALECT_GENERIC.
- */
- public final static String DB_DIALECT_GENERIC = "Generic".intern();
-
- /**
- * DB_DIALECT_ORACLE.
- */
- public final static String DB_DIALECT_ORACLE = "Oracle".intern();
-
- /**
- * DB_DIALECT_ORACLEOCI.
- */
- public final static String DB_DIALECT_ORACLEOCI = "Oracle-OCI".intern();
-
- /**
- * DB_DIALECT_PGSQL.
- */
- public final static String DB_DIALECT_PGSQL = "PgSQL".intern();
-
- /**
- * DB_DIALECT_MYSQL.
- */
- public final static String DB_DIALECT_MYSQL = "MySQL".intern();
-
- /**
- * DB_DIALECT_MYSQL_UTF8.
- */
- public final static String DB_DIALECT_MYSQL_UTF8 = "MySQL-UTF8".intern();
-
- /**
- * DB_DIALECT_MYSQL_MYISAM.
- */
- public final static String DB_DIALECT_MYSQL_MYISAM = "MySQL-MyISAM".intern();
-
- /**
- * DB_DIALECT_MYSQL_MYISAM_UTF8.
- */
- public final static String DB_DIALECT_MYSQL_MYISAM_UTF8 = "MySQL-MyISAM-UTF8".intern();
-
- /**
- * DB_DIALECT_HSQLDB.
- */
- public final static String DB_DIALECT_HSQLDB = "HSQLDB".intern();
-
- /**
- * DB_DIALECT_DB2.
- */
- public final static String DB_DIALECT_DB2 = "DB2".intern();
-
- /**
- * DB_DIALECT_DB2V8.
- */
- public final static String DB_DIALECT_DB2V8 = "DB2V8".intern();
-
- /**
- * DB_DIALECT_MSSQL.
- */
- public final static String DB_DIALECT_MSSQL = "MSSQL".intern();
-
- /**
- * DB_DIALECT_SYBASE.
- */
- public final static String DB_DIALECT_SYBASE = "Sybase".intern();
-
- /**
- * DB_DIALECT_DERBY.
- */
- public final static String DB_DIALECT_DERBY = "Derby".intern();
-
- /**
- * DB_DIALECT_INGRES.
- */
- public final static String DB_DIALECT_INGRES = "Ingres".intern();
-
- /**
- * DB_DIALECT_H2.
- */
- public final static String DB_DIALECT_H2 = "H2".intern();
-
- /**
- * DB_DIALECTS.
- */
- public final static String[] DB_DIALECTS = {DB_DIALECT_GENERIC, DB_DIALECT_ORACLE, DB_DIALECT_ORACLEOCI,
- DB_DIALECT_PGSQL, DB_DIALECT_MYSQL, DB_DIALECT_HSQLDB, DB_DIALECT_DB2, DB_DIALECT_DB2V8, DB_DIALECT_MSSQL,
- DB_DIALECT_SYBASE, DB_DIALECT_DERBY, DB_DIALECT_MYSQL_UTF8, DB_DIALECT_INGRES, DB_DIALECT_H2,
- DB_DIALECT_MYSQL_MYISAM, DB_DIALECT_MYSQL_MYISAM_UTF8};
-
}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.storage.jdbc;
-
-import org.exoplatform.commons.utils.SecurityHelper;
-
-import java.security.PrivilegedExceptionAction;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-
-/**
- * JDBC dialect detecter based on database metadata and vendor product name.
- *
- * @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
- * @version $Id:DialectDetecter.java 1111 2010-01-01 00:00:01Z pnedonosko $
- *
- */
-public class DialectDetecter
-{
-
- /**
- * Detect databse dialect using JDBC metadata. Based on code of
- * http://svn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hi...
- * dialect/resolver/StandardDialectResolver.java
- *
- * @param jdbcConn Connection
- * @return String
- * @throws SQLException if error occurs
- */
- public static String detect(final DatabaseMetaData metaData) throws SQLException
- {
- final String databaseName =
- SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
- {
- public String run() throws Exception
- {
- return metaData.getDatabaseProductName();
- }
- });
-
- if ("HSQL Database Engine".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_HSQLDB;
- }
-
- if ("H2".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_H2;
- }
-
- if ("MySQL".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_MYSQL;
- }
-
- if ("PostgreSQL".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_PGSQL;
- }
-
- if ("Apache Derby".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_DERBY;
- }
-
- if ("ingres".equalsIgnoreCase(databaseName))
- {
- return DBConstants.DB_DIALECT_INGRES;
- }
-
- if (databaseName.startsWith("Microsoft SQL Server"))
- {
- return DBConstants.DB_DIALECT_MSSQL;
- }
-
- if ("Sybase SQL Server".equals(databaseName) || "Adaptive Server Enterprise".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_SYBASE;
- }
-
- if (databaseName.startsWith("Adaptive Server Anywhere"))
- {
- return DBConstants.DB_DIALECT_SYBASE;
- }
-
- if (databaseName.startsWith("DB2/"))
- {
- return DBConstants.DB_DIALECT_DB2;
- }
-
- if ("Oracle".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_ORACLE;
-
- // int databaseMajorVersion = metaData.getDatabaseMajorVersion();
- // switch ( databaseMajorVersion ) {
- // case 11:
- // log.warn( "Oracle 11g is not yet fully supported; using 10g dialect" );
- // return new Oracle10gDialect();
- // case 10:
- // return new Oracle10gDialect();
- // case 9:
- // return new Oracle9iDialect();
- // case 8:
- // return new Oracle8iDialect();
- // default:
- // log.warn( "unknown Oracle major version [" + databaseMajorVersion + "]" );
- // }
- }
-
- return DBConstants.DB_DIALECT_GENERIC;
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -1,94 +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.jcr.impl.storage.jdbc;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * This class provides JDBC tools
- *
- * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
- * @version $Id$
- *
- */
-public class JDBCUtils
-{
- private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JDBCUtils");
-
- private JDBCUtils()
- {
- }
-
- /**
- * Indicates whether or not a given table exists
- * @param tableName the name of the table to check
- * @param con the connection to use
- * @return <code>true</code> if it exists, <code>false</code> otherwise
- */
- public static boolean tableExists(String tableName, Connection con)
- {
- Statement stmt = null;
- ResultSet trs = null;
- try
- {
- stmt = con.createStatement();
- trs = stmt.executeQuery("SELECT count(*) FROM " + tableName);
- return trs.next();
- }
- catch (SQLException e)
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("SQLException occurs while checking the table " + tableName, e);
- }
- return false;
- }
- finally
- {
- if (trs != null)
- {
- try
- {
- trs.close();
- }
- catch (SQLException e)
- {
- LOG.error("Can't close the ResultSet: " + e);
- }
- }
- if (stmt != null)
- {
- try
- {
- stmt.close();
- }
- catch (SQLException e)
- {
- LOG.error("Can't close the Statement: " + e);
- }
- }
- }
- }
-}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -21,7 +21,8 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
-import org.exoplatform.services.database.utils.ExceptionManagementHelper;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.ValueStorageEntry;
@@ -273,7 +274,7 @@
String pDbDialect = null;
try
{
- pDbDialect = DBInitializerHelper.validateDialect(wsConfig.getContainer().getParameterValue(DB_DIALECT));
+ pDbDialect = validateDialect(wsConfig.getContainer().getParameterValue(DB_DIALECT));
}
catch (RepositoryConfigurationException e)
{
@@ -915,8 +916,7 @@
}
catch (SQLException e)
{
- LOG.error(
- "Can't remove lock properties because of " + ExceptionManagementHelper.getFullSQLExceptionMessage(e), e);
+ LOG.error("Can't remove lock properties because of " + JDBCUtils.getFullMessage(e), e);
}
catch (RepositoryException e)
{
@@ -1398,4 +1398,26 @@
throw new RepositoryException("Datasource '" + dbSourceName + "' is not bound in this context.", e);
}
}
+
+ /**
+ * Validate dialect.
+ *
+ * @param confParam
+ * String, dialect from configuration.
+ * @return String
+ * return dialect. By default return DB_DIALECT_GENERIC.
+ *
+ */
+ private String validateDialect(String confParam)
+ {
+ for (String dbType : DBConstants.DB_DIALECTS)
+ {
+ if (dbType.equalsIgnoreCase(confParam))
+ {
+ return dbType;
+ }
+ }
+
+ return DBConstants.DB_DIALECT_GENERIC; // by default
+ }
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -19,10 +19,10 @@
package org.exoplatform.services.jcr.impl.storage.value.cas;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
-import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCUtils;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -18,9 +18,10 @@
*/
package org.exoplatform.services.jcr.impl.util.jdbc;
+import org.exoplatform.commons.utils.IOUtil;
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
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.database.utils.JDBCUtils;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -89,8 +90,7 @@
{
this.connection = connection;
this.containerName = containerName;
- this.script = script(scriptPath);
-
+ this.script = IOUtil.getStreamContentAsString(PrivilegedFileHelper.getResourceAsStream(scriptPath));
this.creatTablePattern = Pattern.compile(SQL_CREATETABLE, Pattern.CASE_INSENSITIVE);
this.creatViewPattern = Pattern.compile(SQL_CREATEVIEW, Pattern.CASE_INSENSITIVE);
this.dbObjectNamePattern = Pattern.compile(SQL_OBJECTNAME, Pattern.CASE_INSENSITIVE);
@@ -101,11 +101,6 @@
this.dbTriggerNamePattern = Pattern.compile(SQL_TRIGGERNAME, Pattern.CASE_INSENSITIVE);
}
- protected String script(String scriptPath) throws IOException
- {
- return DBInitializerHelper.readScriptResource(scriptPath);
- }
-
protected boolean isTableExists(final Connection conn, final String tableName) throws SQLException
{
return SecurityHelper.doPrivilegedAction(new PrivilegedAction<Boolean>()
@@ -250,7 +245,7 @@
public void init() throws DBInitializerException
{
- String[] scripts = DBInitializerHelper.scripts(script);
+ String[] scripts = JDBCUtils.splitWithSQLDelimiter(script);
String sql = null;
Statement st = null;
Set<String> existingTables = new HashSet<String>();
@@ -263,7 +258,7 @@
connection.setAutoCommit(true);
for (String scr : scripts)
{
- String s = DBInitializerHelper.cleanWhitespaces(scr.trim());
+ String s = JDBCUtils.cleanWhitespaces(scr.trim());
if (s.length() > 0)
{
if (isObjectExists(connection, sql = s, existingTables))
@@ -319,8 +314,8 @@
else
{
String msg =
- "Could not create db schema of DataSource: '" + containerName + "'. Reason: " + e.getMessage() + "; "
- + ExceptionManagementHelper.getFullSQLExceptionMessage(e) + ". Last command: " + sql;
+ "Could not create db schema of DataSource: '" + containerName + "'. Reason: " + e.getMessage() + "; "
+ + JDBCUtils.getFullMessage(e) + ". Last command: " + sql;
throw new DBInitializerException(msg, e);
}
@@ -355,6 +350,5 @@
*/
protected void postInit(Connection connection) throws SQLException
{
-
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java 2012-01-06 09:43:10 UTC (rev 5426)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java 2012-01-06 09:44:12 UTC (rev 5427)
@@ -16,7 +16,9 @@
*/
package org.exoplatform.services.jcr.impl.util.jdbc;
-import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.IOUtil;
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.services.database.utils.JDBCUtils;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
@@ -24,9 +26,6 @@
import org.exoplatform.services.log.Log;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.security.PrivilegedAction;
/**
* Created by The eXo Platform SAS.
@@ -42,18 +41,8 @@
* Logger.
*/
protected final static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.DBInitializerHelper");
-
- /**
- * Default SQL delimiter.
- */
- static public String SQL_DELIMITER = ";";
/**
- * SQL delimiter comment prefix.
- */
- static public String SQL_DELIMITER_COMMENT_PREFIX = "/*$DELIMITER:";
-
- /**
* Getting path to initialization by specific dialect and multidb.
*
* @param dbDialect
@@ -131,119 +120,6 @@
}
/**
- * Validate dialect.
- *
- * @param confParam
- * String, dialect from configuration.
- * @return String
- * return dialect. By default return DB_DIALECT_GENERIC.
- *
- */
- public static String validateDialect(String confParam)
- {
- for (String dbType : DBConstants.DB_DIALECTS)
- {
- if (dbType.equalsIgnoreCase(confParam))
- {
- return dbType;
- }
- }
-
- return DBConstants.DB_DIALECT_GENERIC; // by default
- }
-
- /**
- * Read DB initialization script as string.
- *
- * @param path
- * String, path to DB initialization script.
- * @return String,
- * DB initialization script as string.
- * @throws IOException
- * Will throw IOException if file with DB initialization script is not exists.
- */
- public static String readScriptResource(final String path) throws IOException
- {
- PrivilegedAction<InputStream> action = new PrivilegedAction<InputStream>()
- {
- public InputStream run()
- {
- return this.getClass().getResourceAsStream(path);
- }
- };
- final InputStream is = SecurityHelper.doPrivilegedAction(action);
-
- PrivilegedAction<InputStreamReader> actionGetReader = new PrivilegedAction<InputStreamReader>()
- {
- public InputStreamReader run()
- {
- return new InputStreamReader(is);
- }
- };
- InputStreamReader isr = SecurityHelper.doPrivilegedAction(actionGetReader);
-
- try
- {
- StringBuilder sbuff = new StringBuilder();
- char[] buff = new char[is.available()];
- int r = 0;
- while ((r = isr.read(buff)) > 0)
- {
- sbuff.append(buff, 0, r);
- }
-
- return sbuff.toString();
- }
- finally
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- }
- }
- }
-
- /**
- * Determinate DB initialization script by separate query.
- *
- * @param script
- * String, DB initialization script as String.
- * @return String[]
- * Queries to DB initialization.
- */
- public static String[] scripts(String script)
- {
- if (script.startsWith(SQL_DELIMITER_COMMENT_PREFIX))
- {
- // read custom prefix
- try
- {
- String s = script.substring(SQL_DELIMITER_COMMENT_PREFIX.length());
- int endOfDelimIndex = s.indexOf("*/");
- String delim = s.substring(0, endOfDelimIndex).trim();
- s = s.substring(endOfDelimIndex + 2).trim();
- return s.split(delim);
- }
- catch (IndexOutOfBoundsException e)
- {
- LOG.warn("Error of parse SQL-script file. Invalid DELIMITER configuration. Valid format is '"
- + SQL_DELIMITER_COMMENT_PREFIX
- + "XXX*/' at begin of the SQL-script file, where XXX - DELIMITER string."
- + " Spaces will be trimed. ", e);
- LOG.info("Using DELIMITER:[" + SQL_DELIMITER + "]");
- return script.split(SQL_DELIMITER);
- }
- }
- else
- {
- return script.split(SQL_DELIMITER);
- }
- }
-
- /**
* Initialization script for root node.
*
* @param multiDb
@@ -259,26 +135,6 @@
}
/**
- * Cleans redundant whitespaces from query.
- */
- public static String cleanWhitespaces(String string)
- {
- if (string != null)
- {
- char[] cc = string.toCharArray();
- for (int ci = cc.length - 1; ci > 0; ci--)
- {
- if (Character.isWhitespace(cc[ci]))
- {
- cc[ci] = ' ';
- }
- }
- return new String(cc);
- }
- return string;
- }
-
- /**
* Get script for creating object (index, etc...)
* @throws RepositoryConfigurationException
*/
@@ -289,7 +145,7 @@
String script;
try
{
- script = DBInitializerHelper.readScriptResource(scriptsPath);
+ script = IOUtil.getStreamContentAsString(PrivilegedFileHelper.getResourceAsStream(scriptsPath));
}
catch (IOException e)
{
@@ -297,9 +153,9 @@
}
String sql = null;
- for (String query : DBInitializerHelper.scripts(script))
+ for (String query : JDBCUtils.splitWithSQLDelimiter(script))
{
- String q = DBInitializerHelper.cleanWhitespaces(query);
+ String q = JDBCUtils.cleanWhitespaces(query);
if (q.contains(objectName))
{
if (sql != null)
14 years, 3 months
exo-jcr SVN: r5426 - in core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database: jdbc and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-06 04:43:10 -0500 (Fri, 06 Jan 2012)
New Revision: 5426
Added:
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectConstants.java
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectDetecter.java
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/JDBCUtils.java
Removed:
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java
Modified:
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/jdbc/DBSchemaCreator.java
Log:
EXOJCR-968: Move DBInitalizer and DBCleaner common code into separated class
Modified: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2012-01-06 09:42:23 UTC (rev 5425)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -19,18 +19,18 @@
package org.exoplatform.services.database.creator;
import org.exoplatform.commons.utils.ClassLoading;
-import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.configuration.ConfigurationException;
import org.exoplatform.container.configuration.ConfigurationManager;
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 org.exoplatform.services.database.utils.DialectConstants;
+import org.exoplatform.services.database.utils.DialectDetecter;
+import org.exoplatform.services.database.utils.JDBCUtils;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.security.PrivilegedExceptionAction;
import java.sql.Connection;
import java.sql.DriverManager;
@@ -121,7 +121,7 @@
this.connectionProperties = connectionProperties;
this.dbUserName = dbUserName;
this.dbPassword = dbPassword;
- this.dbScript = findScriptResource(scriptPath, cm);
+ this.dbScript = readScript(scriptPath, cm);
}
/**
@@ -187,7 +187,7 @@
String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
if (scriptPath != null)
{
- this.dbScript = findScriptResource(scriptPath, cm);
+ this.dbScript = readScript(scriptPath, cm);
}
else
{
@@ -228,23 +228,23 @@
Connection conn = openConnection();
try
{
- String dbProductName = getDBProductName(conn);
+ String dialect = DialectDetecter.detect(conn.getMetaData());
- if (dbProductName.startsWith("Microsoft SQL Server") || dbProductName.startsWith("Adaptive Server Anywhere")
- || dbProductName.equals("Sybase SQL Server") || dbProductName.equals("Adaptive Server Enterprise"))
+ if (dialect.equalsIgnoreCase(DialectConstants.DB_DIALECT_MSSQL)
+ || dialect.equalsIgnoreCase(DialectConstants.DB_DIALECT_SYBASE))
{
- executeAutoCommitMode(conn, dbName);
+ executeInAutoCommitMode(conn, dbName);
}
else
{
- executeBatchMode(conn, dbName);
+ executeInBatchMode(conn, dbName);
}
- return constructDBConnectionInfo(dbName, dbProductName);
+ return constructDBConnectionInfo(dbName, dialect);
}
catch (SQLException e)
{
- throw new DBCreatorException("Can't execute SQL script : " + ExceptionManagementHelper.getFullSQLExceptionMessage(e));
+ throw new DBCreatorException("Can't execute SQL script : " + JDBCUtils.getFullMessage(e));
}
finally
{
@@ -272,8 +272,12 @@
Connection conn = openConnection();
try
{
- return constructDBConnectionInfo(dbName, getDBProductName(conn));
+ return constructDBConnectionInfo(dbName, DialectDetecter.detect(conn.getMetaData()));
}
+ catch (SQLException e)
+ {
+ throw new DBCreatorException("Can not get database connection information", e);
+ }
finally
{
try
@@ -297,7 +301,7 @@
* @throws SQLException
* if any errors occurs
*/
- private void executeBatchMode(Connection conn, String dbName) throws SQLException
+ private void executeInBatchMode(Connection conn, String dbName) throws SQLException
{
Statement statement = conn.createStatement();
for (String scr : dbScript.split(";"))
@@ -306,7 +310,7 @@
scr = scr.replace(USERNAME_TEMPLATE, dbUserName);
scr = scr.replace(PASSWORD_TEMPLATE, dbPassword);
- String s = cleanWhitespaces(scr.trim());
+ String s = JDBCUtils.cleanWhitespaces(scr.trim());
if (s.length() > 0)
{
statement.addBatch(s);
@@ -320,26 +324,27 @@
*
* @param dbName
* database name
- * @param dbProductName
- * database product name
+ * @param dialect
+ * dialect
* @param serverUrl
* url to DB server
* @param connectionProperties
* connection properties
* @return DBConnectionInfo
*/
- private DBConnectionInfo constructDBConnectionInfo(String dbName, String dbProductName)
+ private DBConnectionInfo constructDBConnectionInfo(String dbName, String dialect)
{
StringBuilder dbUrl = new StringBuilder(serverUrl);
- if (dbProductName.startsWith("Microsoft SQL Server"))
+ if (dialect.equalsIgnoreCase(DialectConstants.DB_DIALECT_MSSQL))
{
dbUrl.append(serverUrl.endsWith(";") ? "" : ";");
dbUrl.append("databaseName=");
dbUrl.append(dbName);
dbUrl.append(";");
}
- else if (dbProductName.equals("Oracle"))
+ else if (dialect.equalsIgnoreCase(DialectConstants.DB_DIALECT_ORACLE)
+ || dialect.equalsIgnoreCase(DialectConstants.DB_DIALECT_ORACLEOCI))
{
// do nothing
}
@@ -375,7 +380,7 @@
* @throws SQLException
* if any errors occurs
*/
- private void executeAutoCommitMode(Connection conn, String dbName) throws SQLException
+ private void executeInAutoCommitMode(Connection conn, String dbName) throws SQLException
{
conn.setAutoCommit(true);
for (String scr : dbScript.split(";"))
@@ -384,7 +389,7 @@
scr = scr.replace(USERNAME_TEMPLATE, dbUserName);
scr = scr.replace(PASSWORD_TEMPLATE, dbPassword);
- String s = cleanWhitespaces(scr.trim());
+ String s = JDBCUtils.cleanWhitespaces(scr.trim());
if (s.length() > 0)
{
conn.createStatement().executeUpdate(s);
@@ -393,31 +398,7 @@
}
/**
- * Read SQL script from {@link InputStream}.
- */
- private String readResource(InputStream is) throws IOException
- {
- InputStreamReader isr = new InputStreamReader(is);
- try
- {
- StringBuilder sbuff = new StringBuilder();
- char[] buff = new char[is.available()];
- int r = 0;
- while ((r = isr.read(buff)) > 0)
- {
- sbuff.append(buff, 0, r);
- }
-
- return sbuff.toString();
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * Find script resource.
+ * Read script resource.
*
* @param scriptPath
* path to the script
@@ -428,46 +409,26 @@
* @throws ConfigurationException
* if script not found
*/
- private String findScriptResource(String scriptPath, ConfigurationManager cm) throws ConfigurationException
+ private String readScript(String scriptPath, ConfigurationManager cm) throws ConfigurationException
{
try
{
- return readResource(cm.getInputStream(scriptPath));
+ return IOUtil.getStreamContentAsString(cm.getInputStream(scriptPath));
}
catch (Exception e)
{
try
{
- return readResource(PrivilegedFileHelper.fileInputStream(scriptPath));
+ return IOUtil.getFileContentAsString(scriptPath);
}
catch (IOException ioe)
{
- throw new ConfigurationException("Can't read script resource " + scriptPath, e);
+ throw new ConfigurationException("Can't read script at " + scriptPath, e);
}
}
}
/**
- * Clean whitespace.
- */
- private String cleanWhitespaces(String string)
- {
- if (string != null)
- {
- char[] cc = string.toCharArray();
- for (int ci = cc.length - 1; ci > 0; ci--)
- {
- if (Character.isWhitespace(cc[ci]))
- {
- cc[ci] = ' ';
- }
- }
- return new String(cc);
- }
- return string;
- }
-
- /**
* Open connection to the DB.
*
* @param connectionProperties
@@ -503,31 +464,4 @@
throw new DBCreatorException("Can't load the JDBC driver " + connectionProperties.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 DBCreatorException
- {
- try
- {
- return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
- {
- public String run() throws Exception
- {
- return conn.getMetaData().getDatabaseProductName();
- }
- });
- }
- catch (SQLException e)
- {
- throw new DBCreatorException("Can't resolve database product name ", e);
- }
- }
}
Modified: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/jdbc/DBSchemaCreator.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/jdbc/DBSchemaCreator.java 2012-01-06 09:42:23 UTC (rev 5425)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/jdbc/DBSchemaCreator.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -19,7 +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.database.utils.JDBCUtils;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.naming.InitialContextInitializer;
@@ -46,11 +46,6 @@
public class DBSchemaCreator
{
-
- static public String SQL_DELIMITER_COMMENT_PREFIX = "/*$DELIMITER:";
-
- static public String SQL_DELIMITER = ";";
-
static private String SQL_ALREADYEXISTS = ".*((already exist)|(duplicate key)| (already used)|(ORA-00955))+.*";
private final Pattern pattern;
@@ -80,36 +75,12 @@
String sql = "";
try
{
- String[] scripts = null;
- if (script.startsWith(SQL_DELIMITER_COMMENT_PREFIX))
- {
- // read custom prefix
- try
- {
- String s = script.substring(SQL_DELIMITER_COMMENT_PREFIX.length());
- int endOfDelimIndex = s.indexOf("*/");
- String delim = s.substring(0, endOfDelimIndex).trim();
- s = s.substring(endOfDelimIndex + 2).trim();
- scripts = s.split(delim);
- }
- catch (IndexOutOfBoundsException e)
- {
- log.warn("Error of parse SQL-script file. Invalid DELIMITER configuration. Valid format is '"
- + SQL_DELIMITER_COMMENT_PREFIX
- + "XXX*/' at begin of the SQL-script file, where XXX - DELIMITER string."
- + " Spaces will be trimed. ", e);
- log.info("Using DELIMITER:[" + SQL_DELIMITER + "]");
- scripts = script.split(SQL_DELIMITER);
- }
- }
- else
- {
- scripts = script.split(SQL_DELIMITER);
- }
+ String[] scripts = JDBCUtils.splitWithSQLDelimiter(script);
for (String scr : scripts)
{
- String s = cleanWhitespaces(scr.trim());
+ String s = JDBCUtils.cleanWhitespaces(scr.trim());
+
if (s.length() < 1)
continue;
sql = s;
@@ -139,7 +110,7 @@
catch (SQLException e)
{
log.error("Could not create db schema of DataSource: '" + dsName + "'. Reason: " + e.getMessage() + "; "
- + ExceptionManagementHelper.getFullSQLExceptionMessage(e) + ". Last command: " + sql, e);
+ + JDBCUtils.getFullMessage(e) + ". Last command: " + sql, e);
}
finally
{
@@ -185,18 +156,4 @@
{
return new DBSchemaCreator(dsName, script);
}
-
- static public String cleanWhitespaces(String string)
- {
- if (string == null || string.length() < 1)
- return string;
- char[] cc = string.toCharArray();
- for (int ci = cc.length - 1; ci > 0; ci--)
- {
- if (Character.isWhitespace(cc[ci]))
- cc[ci] = ' ';
- }
- return new String(cc);
- }
-
}
Added: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectConstants.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectConstants.java (rev 0)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectConstants.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2012 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.database.utils;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: DialectConstants.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class DialectConstants
+{
+ /**
+ * DB_DIALECT_AUTO.
+ */
+ public final static String DB_DIALECT_AUTO = "Auto".intern();
+
+ /**
+ * DB_DIALECT_GENERIC.
+ */
+ public final static String DB_DIALECT_GENERIC = "Generic".intern();
+
+ /**
+ * DB_DIALECT_ORACLE.
+ */
+ public final static String DB_DIALECT_ORACLE = "Oracle".intern();
+
+ /**
+ * DB_DIALECT_ORACLEOCI.
+ */
+ public final static String DB_DIALECT_ORACLEOCI = "Oracle-OCI".intern();
+
+ /**
+ * DB_DIALECT_PGSQL.
+ */
+ public final static String DB_DIALECT_PGSQL = "PgSQL".intern();
+
+ /**
+ * DB_DIALECT_MYSQL.
+ */
+ public final static String DB_DIALECT_MYSQL = "MySQL".intern();
+
+ /**
+ * DB_DIALECT_MYSQL_UTF8.
+ */
+ public final static String DB_DIALECT_MYSQL_UTF8 = "MySQL-UTF8".intern();
+
+ /**
+ * DB_DIALECT_MYSQL_MYISAM.
+ */
+ public final static String DB_DIALECT_MYSQL_MYISAM = "MySQL-MyISAM".intern();
+
+ /**
+ * DB_DIALECT_MYSQL_MYISAM_UTF8.
+ */
+ public final static String DB_DIALECT_MYSQL_MYISAM_UTF8 = "MySQL-MyISAM-UTF8".intern();
+
+ /**
+ * DB_DIALECT_HSQLDB.
+ */
+ public final static String DB_DIALECT_HSQLDB = "HSQLDB".intern();
+
+ /**
+ * DB_DIALECT_DB2.
+ */
+ public final static String DB_DIALECT_DB2 = "DB2".intern();
+
+ /**
+ * DB_DIALECT_DB2V8.
+ */
+ public final static String DB_DIALECT_DB2V8 = "DB2V8".intern();
+
+ /**
+ * DB_DIALECT_MSSQL.
+ */
+ public final static String DB_DIALECT_MSSQL = "MSSQL".intern();
+
+ /**
+ * DB_DIALECT_SYBASE.
+ */
+ public final static String DB_DIALECT_SYBASE = "Sybase".intern();
+
+ /**
+ * DB_DIALECT_DERBY.
+ */
+ public final static String DB_DIALECT_DERBY = "Derby".intern();
+
+ /**
+ * DB_DIALECT_INGRES.
+ */
+ public final static String DB_DIALECT_INGRES = "Ingres".intern();
+
+ /**
+ * DB_DIALECT_H2.
+ */
+ public final static String DB_DIALECT_H2 = "H2".intern();
+
+ /**
+ * DB_DIALECTS.
+ */
+ public final static String[] DB_DIALECTS = {DB_DIALECT_GENERIC, DB_DIALECT_ORACLE, DB_DIALECT_ORACLEOCI,
+ DB_DIALECT_PGSQL, DB_DIALECT_MYSQL, DB_DIALECT_HSQLDB, DB_DIALECT_DB2, DB_DIALECT_DB2V8, DB_DIALECT_MSSQL,
+ DB_DIALECT_SYBASE, DB_DIALECT_DERBY, DB_DIALECT_MYSQL_UTF8, DB_DIALECT_INGRES, DB_DIALECT_H2,
+ DB_DIALECT_MYSQL_MYISAM, DB_DIALECT_MYSQL_MYISAM_UTF8};
+
+}
Added: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectDetecter.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectDetecter.java (rev 0)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/DialectDetecter.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.database.utils;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+
+import java.security.PrivilegedExceptionAction;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+
+/**
+ * JDBC dialect detecter based on database metadata and vendor product name.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
+ * @version $Id:DialectDetecter.java 1111 2010-01-01 00:00:01Z pnedonosko $
+ */
+public class DialectDetecter
+{
+
+ /**
+ * Detect databse dialect using JDBC metadata. Based on code of
+ * http://svn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hi...
+ * dialect/resolver/StandardDialectResolver.java
+ *
+ * @param jdbcConn Connection
+ * @return String
+ * @throws SQLException if error occurs
+ */
+ public static String detect(final DatabaseMetaData metaData) throws SQLException
+ {
+ final String databaseName =
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
+ {
+ public String run() throws Exception
+ {
+ return metaData.getDatabaseProductName();
+ }
+ });
+
+ if ("HSQL Database Engine".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_HSQLDB;
+ }
+
+ if ("H2".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_H2;
+ }
+
+ if ("MySQL".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_MYSQL;
+ }
+
+ if ("PostgreSQL".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_PGSQL;
+ }
+
+ if ("Apache Derby".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_DERBY;
+ }
+
+ if ("ingres".equalsIgnoreCase(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_INGRES;
+ }
+
+ if (databaseName.startsWith("Microsoft SQL Server"))
+ {
+ return DialectConstants.DB_DIALECT_MSSQL;
+ }
+
+ if ("Sybase SQL Server".equals(databaseName) || "Adaptive Server Enterprise".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_SYBASE;
+ }
+
+ if (databaseName.startsWith("Adaptive Server Anywhere"))
+ {
+ return DialectConstants.DB_DIALECT_SYBASE;
+ }
+
+ if (databaseName.startsWith("DB2/"))
+ {
+ return DialectConstants.DB_DIALECT_DB2;
+ }
+
+ if ("Oracle".equals(databaseName))
+ {
+ return DialectConstants.DB_DIALECT_ORACLE;
+ }
+
+ return DialectConstants.DB_DIALECT_GENERIC;
+ }
+}
Deleted: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java 2012-01-06 09:42:23 UTC (rev 5425)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -1,55 +0,0 @@
-/*
- * 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<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.services.database.utils;
-
-import java.sql.SQLException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * <br/>Date: 2011
- *
- * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: ExceptionManagementHelper.java 111 2011-11-11 11:11:11Z rainf0x $
- */
-public class ExceptionManagementHelper
-{
- /**
- * Prepare message from SQLException.
- *
- * @param e
- * SQLException
- * @return String
- * The message form SQLException
- */
- public static String getFullSQLExceptionMessage(SQLException e)
- {
- SQLException next = e.getNextException();
- StringBuilder errorTrace = new StringBuilder();
-
- while (next != null)
- {
- errorTrace.append(next.getMessage());
- errorTrace.append("; ");
- next = next.getNextException();
- }
-
- Throwable cause = e.getCause();
-
- return errorTrace + (cause != null ? " (Cause: " + cause.getMessage() + ")" : "");
- }
-}
Added: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/JDBCUtils.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/JDBCUtils.java (rev 0)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/JDBCUtils.java 2012-01-06 09:43:10 UTC (rev 5426)
@@ -0,0 +1,193 @@
+/*
+ * 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.database.utils;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * This class provides JDBC tools
+ *
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ */
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: JDBCUtils.java 34360 2009-07-22 23:58:59Z tolusha $
+ *
+ */
+public class JDBCUtils
+{
+ private static final Log LOG = ExoLogger.getLogger("exo.core.component.database.JDBCUtils");
+
+ /**
+ * Default SQL delimiter.
+ */
+ public static final String SQL_DELIMITER = ";";
+
+ /**
+ * SQL delimiter comment prefix.
+ */
+ public static final String SQL_DELIMITER_COMMENT_PREFIX = "/*$DELIMITER:";
+
+ public static final String SQL_DELIMITER_COMMENT_SUFFIX = "*/";
+
+ private JDBCUtils()
+ {
+ }
+
+ /**
+ * Indicates whether or not a given table exists
+ *
+ * @param tableName
+ * the name of the table to check
+ * @param con
+ * the connection to use
+ * @return <code>true</code> if it exists, <code>false</code> otherwise
+ */
+ public static boolean tableExists(String tableName, Connection con)
+ {
+ Statement stmt = null;
+ ResultSet trs = null;
+ try
+ {
+ stmt = con.createStatement();
+ trs = stmt.executeQuery("SELECT count(*) FROM " + tableName);
+ return trs.next();
+ }
+ catch (SQLException e)
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("SQLException occurs while checking the table " + tableName, e);
+ }
+ return false;
+ }
+ finally
+ {
+ if (trs != null)
+ {
+ try
+ {
+ trs.close();
+ }
+ catch (SQLException e)
+ {
+ LOG.error("Can't close the ResultSet: " + e);
+ }
+ }
+ if (stmt != null)
+ {
+ try
+ {
+ stmt.close();
+ }
+ catch (SQLException e)
+ {
+ LOG.error("Can't close the Statement: " + e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Retrieves the full message from SQLException.
+ *
+ * @param exception
+ * SQLException which will be parsed
+ */
+ public static String getFullMessage(SQLException exception)
+ {
+ StringBuilder errorTrace = new StringBuilder(exception.getMessage());
+
+ SQLException next = exception.getNextException();
+ while (next != null)
+ {
+ errorTrace.append("; ");
+ errorTrace.append(next.getMessage());
+
+ next = next.getNextException();
+ }
+
+ Throwable cause = exception.getCause();
+
+ return errorTrace + (cause != null ? " (Cause: " + cause.getMessage() + ")" : "");
+ }
+
+ /**
+ * Replace whitespace characters with space character.
+ */
+ public static String cleanWhitespaces(String string)
+ {
+ if (string != null)
+ {
+ char[] cc = string.toCharArray();
+ for (int ci = cc.length - 1; ci > 0; ci--)
+ {
+ if (Character.isWhitespace(cc[ci]))
+ {
+ cc[ci] = ' ';
+ }
+ }
+ return new String(cc);
+ }
+ return string;
+ }
+
+ /**
+ * Split string resource with SQL Delimiter. Delimiter can be taken from resource
+ * at the begining of the first line. It surrounded with {@link #SQL_DELIMITER_COMMENT_PREFIX}
+ * and {@link #SQL_DELIMITER_COMMENT_SUFFIX}. Otherwise the default delimiter will
+ * be used {@link #SQL_DELIMITER}.
+ */
+ public static String[] splitWithSQLDelimiter(String resource)
+ {
+ if (resource.startsWith(SQL_DELIMITER_COMMENT_PREFIX))
+ {
+ try
+ {
+ String scripts = resource.substring(SQL_DELIMITER_COMMENT_PREFIX.length());
+
+ int endOfDelimIndex = scripts.indexOf(SQL_DELIMITER_COMMENT_SUFFIX);
+ String delim = scripts.substring(0, endOfDelimIndex).trim();
+
+ scripts = scripts.substring(endOfDelimIndex + 2).trim();
+ return scripts.split(delim);
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ LOG.warn("Error of parse SQL-script file. Invalid DELIMITER configuration. Valid format is '"
+ + SQL_DELIMITER_COMMENT_PREFIX + "XXX*/' at begin of the SQL-script file, where XXX - DELIMITER string."
+ + " Spaces will be trimed. ", e);
+ LOG.info("Using DELIMITER:[" + SQL_DELIMITER + "]");
+
+ return resource.split(SQL_DELIMITER);
+ }
+ }
+ else
+ {
+ return resource.split(SQL_DELIMITER);
+ }
+ }
+}
14 years, 3 months
exo-jcr SVN: r5425 - kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-06 04:42:23 -0500 (Fri, 06 Jan 2012)
New Revision: 5425
Modified:
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java
Log:
EXOJCR-968: Move DBInitalizer and DBCleaner common code into separated class
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-05 10:42:24 UTC (rev 5424)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-06 09:42:23 UTC (rev 5425)
@@ -68,7 +68,7 @@
{
throw new NullPointerException("No null file accepted");
}
- FileInputStream is = new FileInputStream(file);
+ FileInputStream is = PrivilegedFileHelper.fileInputStream(file);
return new String(getStreamContentAsBytes(is), charset);
}
@@ -132,7 +132,7 @@
{
throw new NullPointerException("No null file name accepted");
}
- FileInputStream is = new FileInputStream(fileName);
+ FileInputStream is = PrivilegedFileHelper.fileInputStream(fileName);
return getStreamContentAsBytes(is);
}
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java 2012-01-05 10:42:24 UTC (rev 5424)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java 2012-01-06 09:42:23 UTC (rev 5425)
@@ -25,6 +25,7 @@
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.io.InputStream;
import java.io.RandomAccessFile;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -42,6 +43,22 @@
{
/**
+ * getResourceAsStream in privileged mode.
+ */
+ public static InputStream getResourceAsStream(final String resource) throws FileNotFoundException
+ {
+ PrivilegedAction<InputStream> action = new PrivilegedAction<InputStream>()
+ {
+ public InputStream run()
+ {
+ return PrivilegedFileHelper.class.getClass().getResourceAsStream(resource);
+ }
+ };
+
+ return SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
* Create FileOutputStream in privileged mode.
*
* @param file
14 years, 3 months
exo-jcr SVN: r5424 - in jcr/branches/1.15.x/exo.jcr.component.core: src/main/resources/conf/storage and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2012-01-05 05:42:24 -0500 (Thu, 05 Jan 2012)
New Revision: 5424
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql
Log:
EXOJCR-1691 : Removed index JCR_IDX_[S,M]ITEM_PARENT_N_ORDER_NUM from MySQL scripts.
Modified: jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-05 10:42:24 UTC (rev 5424)
@@ -4,4 +4,5 @@
* Removed LockPersister
* Removed LockManagerImpl
* If lock manager is not configured we will have RepositoryConfigurationException at startup
-* Index JCR_XITEM_PARENT_NAME removed (JCR_IDX_MITEM_PN - for DB2)
\ No newline at end of file
+* Index JCR_XITEM_PARENT_NAME removed (JCR_IDX_MITEM_PN - for DB2)
+* Index JCR_IDX_XITEM_PARENT_N_ORDER_NUM from MySQL scripts.
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -13,7 +13,6 @@
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -13,7 +13,6 @@
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -13,7 +13,6 @@
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -13,7 +13,6 @@
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -14,7 +14,6 @@
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -14,7 +14,6 @@
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -14,7 +14,6 @@
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
ID SERIAL NOT NULL,
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql 2012-01-05 09:57:44 UTC (rev 5423)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql 2012-01-05 10:42:24 UTC (rev 5424)
@@ -14,7 +14,6 @@
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
-CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
ID SERIAL NOT NULL,
14 years, 3 months
exo-jcr SVN: r5423 - in jcr/branches/1.15.x/exo.jcr.component.core/src/test: java/org/exoplatform/services/jcr/api/reading and 1 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-05 04:57:44 -0500 (Thu, 05 Jan 2012)
New Revision: 5423
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportDocView.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportSysView.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/reading/TestSession.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-usecase.xml
Log:
EXOJCR-1703: Writed test to class SessionImpl
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportDocView.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportDocView.java 2012-01-04 14:22:16 UTC (rev 5422)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportDocView.java 2012-01-05 09:57:44 UTC (rev 5423)
@@ -36,6 +36,7 @@
import java.util.Calendar;
import java.util.StringTokenizer;
+import javax.jcr.InvalidSerializedDataException;
import javax.jcr.ItemExistsException;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
@@ -410,4 +411,32 @@
assertFalse(exportContent.contains("newjcr"));
newSession.logout();
}
+
+ public void testExportDocumentViewWhenPathNotFound() throws IOException, InvalidSerializedDataException,
+ SAXException, RepositoryException
+ {
+ try
+ {
+ session.exportDocumentView("/TestChildNode", new MockContentHandler(), false, false);
+ fail();
+ }
+ catch (PathNotFoundException e)
+ {
+ }
+
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try
+ {
+ session.exportDocumentView("/TestChildNode", out, false, false);
+ fail();
+ }
+ catch (PathNotFoundException e)
+ {
+ }
+ finally
+ {
+ out.close();
+ }
+ }
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportSysView.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportSysView.java 2012-01-04 14:22:16 UTC (rev 5422)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/exporting/TestExportSysView.java 2012-01-05 09:57:44 UTC (rev 5423)
@@ -413,4 +413,31 @@
assertEquals(1, mock.nodes);
assertEquals(2, mock.properties);
}
+
+ public void testExportSystemViewWhenPathNotFound() throws IOException, SAXException, RepositoryException
+ {
+ try
+ {
+ session.exportSystemView("/testNode", new MockContentHandler(), false, true);
+ fail();
+ }
+ catch (PathNotFoundException e)
+ {
+ }
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ try
+ {
+ session.exportSystemView("/testNode", out, false, false);
+ fail();
+ }
+ catch (PathNotFoundException e)
+ {
+ }
+ finally
+ {
+ out.close();
+ }
+ }
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/reading/TestSession.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/reading/TestSession.java 2012-01-04 14:22:16 UTC (rev 5422)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/reading/TestSession.java 2012-01-05 09:57:44 UTC (rev 5423)
@@ -20,17 +20,27 @@
import org.exoplatform.services.jcr.JcrAPIBaseTest;
import org.exoplatform.services.jcr.core.CredentialsImpl;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
import java.util.Calendar;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
import javax.jcr.LoginException;
+import javax.jcr.NamespaceException;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.version.VersionException;
/**
* Created by The eXo Platform SAS.
@@ -161,4 +171,136 @@
}
-}
+ public void testGetAllNamespacePrefixes() throws RepositoryException
+ {
+ assertTrue(Arrays.asList(session.getWorkspace().getNamespaceRegistry().getPrefixes()).containsAll(
+ Arrays.asList(session.getAllNamespacePrefixes())));
+ }
+
+ public void testGetImportContentHandlerCheckLockException() throws ItemExistsException, PathNotFoundException,
+ VersionException, ConstraintViolationException, LockException, RepositoryException
+ {
+ Node testNode = root.addNode("test");
+ testNode.addMixin("mix:lockable");
+ session.save();
+
+ testNode.lock(true, true);
+
+ Session session2 =
+ repository.login(new CredentialsImpl("admin", "admin".toCharArray()), session.getWorkspace().getName());
+
+ try
+ {
+ session2.getImportContentHandler("/test", 0);
+ fail();
+ }
+ catch (LockException e)
+ {
+ }
+ finally
+ {
+ session2.logout();
+ testNode.unlock();
+ }
+ }
+
+ public void testGetImportContentHandlerCheckConstraintViolationException() throws ItemExistsException,
+ PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
+ {
+ root.addNode("someNode", "exo:myTypeJCR1703");
+
+ try
+ {
+ session.getImportContentHandler("/someNode/exo:myChildNode", 0);
+ fail();
+ }
+ catch (ConstraintViolationException e)
+ {
+ }
+ }
+
+ public void testImportXMLCheckLockException() throws ItemExistsException, PathNotFoundException,
+ NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException,
+ IOException
+ {
+ Node testNode = root.addNode("testNode");
+ testNode.setProperty("exo:title", "testNode");
+ testNode.addMixin("mix:versionable");
+
+ Node testNodeImport = root.addNode("testNodeImport");
+ testNodeImport.addMixin("mix:lockable");
+ session.save();
+
+ testNodeImport.lock(true, true);
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ testNode.getSession().exportDocumentView(testNode.getPath(), bos, false, false);
+ ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
+
+ Session session2 =
+ repository.login(new CredentialsImpl("admin", "admin".toCharArray()), session.getWorkspace().getName());
+
+ try
+ {
+ session2.importXML(testNodeImport.getPath(), is, 1);
+ fail();
+ }
+ catch (LockException e)
+ {
+ }
+ finally
+ {
+ session2.logout();
+ testNodeImport.unlock();
+ }
+ }
+
+ public void testImportXMLCheckConstraintViolationException() throws ItemExistsException, PathNotFoundException,
+ VersionException, ConstraintViolationException, LockException, RepositoryException, IOException
+ {
+ Node testNode = root.addNode("testNode");
+ testNode.setProperty("exo:title", "testNode");
+ testNode.addMixin("mix:versionable");
+
+ root.addNode("someNode", "exo:myTypeJCR1703");
+ session.save();
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ testNode.getSession().exportDocumentView(testNode.getPath(), bos, false, false);
+ ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
+
+ try
+ {
+ session.importXML("/someNode/exo:myChildNode", is, 1);
+ fail();
+ }
+ catch (ConstraintViolationException e)
+ {
+ }
+ }
+
+ public void testGetNodeByIdentifierWhenNodeNotFound() throws ItemExistsException, PathNotFoundException,
+ VersionException, ConstraintViolationException, LockException, RepositoryException
+ {
+ try
+ {
+ session.getNodeByIdentifier("someidentifier");
+ fail();
+ }
+ catch (ItemNotFoundException e)
+ {
+ }
+ }
+
+ public void testSetNamespacePrefix() throws RepositoryException
+ {
+ try
+ {
+ session.setNamespacePrefix("nt", "http://www.jcp.org/jcr/1.0");
+ fail();
+ }
+ catch (NamespaceException e)
+ {
+ }
+ }
+}
\ No newline at end of file
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-usecase.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-usecase.xml 2012-01-04 14:22:16 UTC (rev 5422)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-usecase.xml 2012-01-05 09:57:44 UTC (rev 5423)
@@ -280,4 +280,17 @@
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
+
+ <nodeType name="exo:myTypeJCR1703" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="exo:myChildNode" defaultPrimaryType="nt:unstructured" autoCreated="true" mandatory="false" onParentVersion="IGNORE" protected="true" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>nt:base</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
</nodeTypes>
14 years, 3 months
exo-jcr SVN: r5422 - in jcr/branches/1.15.x: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms and 7 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-04 09:22:16 -0500 (Wed, 04 Jan 2012)
New Revision: 5422
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2v8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.derby.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.h2.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ingres.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mssql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.pgsql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sybase.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2v8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.derby.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.h2.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ingres.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mssql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.pgsql.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sybase.sql
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/TestRepositoryCheckController.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/database/TestIDNumeric.java
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
Log:
EXOJCR-1652: index removed JCR_IDX_SITEM_PARENT_NAME
Modified: jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-04 14:22:16 UTC (rev 5422)
@@ -3,4 +3,5 @@
* "update-storage" parameter in Workspace data container configuration is not supported anymore
* Removed LockPersister
* Removed LockManagerImpl
-* If lock manager is not configured we will have RepositoryConfigurationException at startup
\ No newline at end of file
+* If lock manager is not configured we will have RepositoryConfigurationException at startup
+* Index JCR_XITEM_PARENT_NAME removed (JCR_IDX_MITEM_PN - for DB2)
\ No newline at end of file
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -276,7 +276,6 @@
dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "ITEM_PARENT_FK");
dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "ITEM_PARENT");
- dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "ITEM_PARENT_NAME");
dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "ITEM_PARENT_ID");
dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "ITEM_N_ORDER_NUM");
dropScript.add("DROP INDEX JCR_IDX_" + multiDb + "VALUE_PROPERTY");
@@ -288,7 +287,6 @@
dropScript.add("ALTER TABLE JCR_" + multiDb + "ITEM DROP CONSTRAINT JCR_PK_" + multiDb + "ITEM");
dropScript.add("ALTER TABLE JCR_" + multiDb + "VALUE DROP CONSTRAINT JCR_PK_" + multiDb + "VALUE");
dropScript.add("DROP INDEX JCR_" + multiDb + "ITEM.JCR_IDX_" + multiDb + "ITEM_PARENT");
- dropScript.add("DROP INDEX JCR_" + multiDb + "ITEM.JCR_IDX_" + multiDb + "ITEM_PARENT_NAME");
dropScript.add("DROP INDEX JCR_" + multiDb + "ITEM.JCR_IDX_" + multiDb + "ITEM_PARENT_ID");
dropScript.add("DROP INDEX JCR_" + multiDb + "ITEM.JCR_IDX_" + multiDb + "ITEM_N_ORDER_NUM");
dropScript.add("DROP INDEX JCR_" + multiDb + "VALUE.JCR_IDX_" + multiDb + "VALUE_PROPERTY");
@@ -333,9 +331,6 @@
addScript.add(DBInitializerHelper.getObjectScript("CREATE UNIQUE INDEX JCR_IDX_" + multiDb
+ "ITEM_PARENT ON JCR_" + multiDb + "ITEM", isMultiDB, dialect));
addScript.add(DBInitializerHelper.getObjectScript("CREATE UNIQUE INDEX JCR_IDX_" + multiDb
- + "ITEM_PARENT_NAME ON JCR_" + multiDb + "ITEM", isMultiDB,
- dialect));
- addScript.add(DBInitializerHelper.getObjectScript("CREATE UNIQUE INDEX JCR_IDX_" + multiDb
+ "ITEM_PARENT_ID ON JCR_" + multiDb + "ITEM", isMultiDB, dialect));
addScript.add(DBInitializerHelper.getObjectScript("CREATE UNIQUE INDEX JCR_IDX_" + multiDb
+ "ITEM_N_ORDER_NUM ON JCR_" + multiDb + "ITEM", isMultiDB, dialect));
@@ -382,8 +377,6 @@
+ "ITEM", isMultiDB, dialect));
addScript.add(DBInitializerHelper.getObjectScript("JCR_IDX_" + multiDb + "ITEM_PARENT ON JCR_" + multiDb
+ "ITEM", isMultiDB, dialect));
- addScript.add(DBInitializerHelper.getObjectScript("JCR_IDX_" + multiDb + "ITEM_PARENT_NAME ON JCR_" + multiDb
- + "ITEM", isMultiDB, dialect));
addScript.add(DBInitializerHelper.getObjectScript("JCR_IDX_" + multiDb + "ITEM_PARENT_ID ON JCR_" + multiDb
+ "ITEM", isMultiDB, dialect));
addScript.add(DBInitializerHelper.getObjectScript("JCR_IDX_" + multiDb + "ITEM_N_ORDER_NUM ON JCR_" + multiDb
@@ -523,8 +516,6 @@
+ "ITEM_PARENT_FK" + OLD_OBJECT_SUFFIX);
renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT RENAME TO JCR_IDX_" + isMultiDB
+ "ITEM_PARENT" + OLD_OBJECT_SUFFIX);
- renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME RENAME TO JCR_IDX_" + isMultiDB
- + "ITEM_PARENT_NAME" + OLD_OBJECT_SUFFIX);
renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID RENAME TO JCR_IDX_" + isMultiDB
+ "ITEM_PARENT_ID" + OLD_OBJECT_SUFFIX);
renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_N_ORDER_NUM RENAME TO JCR_IDX_" + isMultiDB
@@ -589,9 +580,6 @@
renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT RENAME TO JCR_IDX_" + isMultiDB
+ "ITEM_PARENT" + OLD_OBJECT_SUFFIX);
- renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME RENAME TO JCR_IDX_" + isMultiDB
- + "ITEM_PARENT_NAME" + OLD_OBJECT_SUFFIX);
-
renameScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID RENAME TO JCR_IDX_" + isMultiDB
+ "ITEM_PARENT_ID" + OLD_OBJECT_SUFFIX);
@@ -661,8 +649,6 @@
+ " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT_FK");
rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT" + OLD_OBJECT_SUFFIX
+ " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT");
- rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME" + OLD_OBJECT_SUFFIX
- + " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME");
rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID" + OLD_OBJECT_SUFFIX
+ " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID");
rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_N_ORDER_NUM" + OLD_OBJECT_SUFFIX
@@ -731,9 +717,6 @@
rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT" + OLD_OBJECT_SUFFIX
+ " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT");
- rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME" + OLD_OBJECT_SUFFIX
- + " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT_NAME");
-
rollbackScripts.add("ALTER INDEX JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID" + OLD_OBJECT_SUFFIX
+ " RENAME TO JCR_IDX_" + isMultiDB + "ITEM_PARENT_ID");
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -44,11 +44,6 @@
protected String JCR_IDX_ITEM_PARENT;
/**
- * JCR_IDX_ITEM_PARENT_NAME.
- */
- protected String JCR_IDX_ITEM_PARENT_NAME;
-
- /**
* JCR_IDX_ITEM_PARENT_ID.
*/
protected String JCR_IDX_ITEM_PARENT_ID;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -42,8 +42,7 @@
*
* JCR_PK_XITEM - Item already exists with this ID JCR_FK_XITEM_PARENT - Parent not found by ID
* JCR_IDX_XITEM_PARENT - Item already exists with the parent, name, index, type(N/P), persisted
- * version JCR_IDX_XITEM_PARENT_NAME - Item already exists with the type(N/P), parent, name, index,
- * persisted version JCR_IDX_XITEM_PARENT_ID - Item already exists with the type(N/P), parent, ID,
+ * version JCR_IDX_XITEM_PARENT_ID - Item already exists with the type(N/P), parent, ID,
* persisted version
*
* JCR_PK_XVALUE - Value already exists with the ID (impossible, ID is autiincremented)
@@ -125,7 +124,7 @@
// InvalidItemStateException ! - because it's impossible add new item with existed UUID
throw new JCRInvalidItemStateException(message.toString(), item.getIdentifier(), ItemState.ADDED, e);
}
- else if (umsg.indexOf(conn.JCR_IDX_ITEM_PARENT) >= 0 || umsg.indexOf(conn.JCR_IDX_ITEM_PARENT_NAME) >= 0)
+ else if (umsg.indexOf(conn.JCR_IDX_ITEM_PARENT) >= 0)
{
message.append("Item already exists. Condition: parent ID, name, index. ").append(itemInfo);
throw new ItemExistsException(message.toString(), e);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -99,7 +99,6 @@
JCR_PK_ITEM = "JCR_PK_MITEM";
JCR_FK_ITEM_PARENT = "JCR_FK_MITEM_PARENT";
JCR_IDX_ITEM_PARENT = "JCR_IDX_MITEM_PARENT";
- JCR_IDX_ITEM_PARENT_NAME = "JCR_IDX_MITEM_PARENT_NAME";
JCR_IDX_ITEM_PARENT_ID = "JCR_IDX_MITEM_PARENT_ID";
JCR_PK_VALUE = "JCR_PK_MVALUE";
JCR_FK_VALUE_PROPERTY = "JCR_FK_MVALUE_PROPERTY";
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -102,7 +102,6 @@
JCR_PK_ITEM = "JCR_PK_SITEM";
JCR_FK_ITEM_PARENT = "JCR_FK_SITEM_PARENT";
JCR_IDX_ITEM_PARENT = "JCR_IDX_SITEM_PARENT";
- JCR_IDX_ITEM_PARENT_NAME = "JCR_IDX_SITEM_PARENT_NAME";
JCR_IDX_ITEM_PARENT_ID = "JCR_IDX_SITEM_PARENT_ID";
JCR_PK_VALUE = "JCR_PK_SVALUE";
JCR_FK_VALUE_PROPERTY = "JCR_FK_SVALUE_PROPERTY";
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -122,7 +122,6 @@
JCR_PK_ITEM = "JCR_PK_MITEM";
JCR_FK_ITEM_PARENT = "JCR_FK_MITEM_PARENT";
JCR_IDX_ITEM_PARENT = "JCR_IDX_MITEM_PARENT";
- JCR_IDX_ITEM_PARENT_NAME = "JCR_IDX_MITEM_PARENT_NAME";
JCR_IDX_ITEM_PARENT_ID = "JCR_IDX_MITEM_PARENT_ID";
JCR_PK_VALUE = "JCR_PK_MVALUE";
JCR_FK_VALUE_PROPERTY = "JCR_FK_MVALUE_PROPERTY";
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -126,7 +126,6 @@
JCR_PK_ITEM = "JCR_PK_SITEM";
JCR_FK_ITEM_PARENT = "JCR_FK_SITEM_PARENT";
JCR_IDX_ITEM_PARENT = "JCR_IDX_SITEM_PARENT";
- JCR_IDX_ITEM_PARENT_NAME = "JCR_IDX_SITEM_PARENT_NAME";
JCR_IDX_ITEM_PARENT_ID = "JCR_IDX_SITEM_PARENT_ID";
JCR_PK_VALUE = "JCR_PK_SVALUE";
JCR_FK_VALUE_PROPERTY = "JCR_FK_SVALUE_PROPERTY";
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PAREN FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2v8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2v8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.db2v8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PAREN FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_P ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_P ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.derby.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.derby.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.derby.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.h2.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.h2.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.h2.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ingres.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ingres.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ingres.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE SEQUENCE JCR_MVALUE_SEQ;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mssql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mssql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mssql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam-utf8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME(255), I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-myisam.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql-utf8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME(255), I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.mysql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_PARENT_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -17,8 +17,6 @@
/
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM( PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC)
/
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_mITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC)
-/
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC)
/
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -17,8 +17,6 @@
/
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM( PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC)
/
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC)
-/
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC)
/
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.pgsql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.pgsql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.pgsql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sybase.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sybase.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sybase.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -12,7 +12,6 @@
CONSTRAINT JCR_FK_MITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT ON JCR_MITEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME ON JCR_MITEM(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_MITEM_N_ORDER_NUM ON JCR_MITEM(I_CLASS, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_MVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PAREN FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PARENT_FK ON JCR_SITEM(PARENT_ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2v8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2v8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.db2v8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PAREN FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_P ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PN ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PFK ON JCR_SITEM(PARENT_ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.derby.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.derby.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.derby.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.h2.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.h2.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.h2.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ingres.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ingres.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ingres.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION);
CREATE INDEX JCR_IDX_SITEM_PARENT_FK ON JCR_SITEM(PARENT_ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mssql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mssql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mssql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam-utf8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-myisam.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
) ENGINE=MyISAM;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql-utf8.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME(255), I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.mysql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
) ENGINE=InnoDB;
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_PARENT_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM, ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -18,8 +18,6 @@
/
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC)
/
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC)
-/
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC)
/
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM)
@@ -63,8 +61,6 @@
/
ANALYZE INDEX JCR_IDX_SITEM_N_ORDER_NUM COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_IDX_SITEM_PARENT_NAME COMPUTE STATISTICS
-/
ANALYZE INDEX JCR_IDX_SITEM_PARENT_ID COMPUTE STATISTICS
/
ANALYZE INDEX JCR_PK_SVALUE COMPUTE STATISTICS
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -18,8 +18,6 @@
/
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC)
/
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC)
-/
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC)
/
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.pgsql.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.pgsql.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.pgsql.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION);
CREATE INDEX JCR_IDX_SITEM_PARENT_FK ON JCR_SITEM(PARENT_ID);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sybase.sql
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sybase.sql 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sybase.sql 2012-01-04 14:22:16 UTC (rev 5422)
@@ -13,7 +13,6 @@
CONSTRAINT JCR_FK_SITEM_PARENT FOREIGN KEY(PARENT_ID) REFERENCES JCR_SITEM(ID)
);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT ON JCR_SITEM(CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC);
-CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_NAME ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, NAME, I_INDEX, VERSION DESC);
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE INDEX JCR_IDX_SITEM_N_ORDER_NUM ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, N_ORDER_NUM);
CREATE TABLE JCR_SVALUE(
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/TestRepositoryCheckController.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/TestRepositoryCheckController.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/TestRepositoryCheckController.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -349,7 +349,6 @@
Connection conn = ((DataSource)new InitialContext().lookup(sourceName)).getConnection();
conn.prepareStatement("DROP INDEX JCR_IDX_" + (isMultiDb ? "M" : "S") + "ITEM_PARENT").execute();
- conn.prepareStatement("DROP INDEX JCR_IDX_" + (isMultiDb ? "M" : "S") + "ITEM_PARENT_NAME").execute();
conn.prepareStatement(
"UPDATE JCR_" + (isMultiDb ? "M" : "S") + "ITEM SET PARENT_ID = '" + (isMultiDb ? "" : wsEntry.getName())
+ node.getInternalIdentifier() + "' WHERE ID='" + (isMultiDb ? "" : wsEntry.getName())
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/database/TestIDNumeric.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/database/TestIDNumeric.java 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/database/TestIDNumeric.java 2012-01-04 14:22:16 UTC (rev 5422)
@@ -53,7 +53,6 @@
+ "CONSTRAINT JCR_PK_MITEM_N PRIMARY KEY(ID), "
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM_N(ID) " + ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, ID, VERSION)"};
public static String[] CREATE_ITEMS_SQL_NUMERIC_DERBY =
@@ -64,7 +63,6 @@
+ "CONSTRAINT JCR_PK_MITEM_N PRIMARY KEY(ID), "
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM_N(ID) " + ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, ID, VERSION)"};
public static String[] CREATE_ITEMS_SQL_NUMERIC_MYSQL =
@@ -75,7 +73,6 @@
+ "CONSTRAINT JCR_PK_MITEM_N PRIMARY KEY(ID), "
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM_N(ID) " + ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, ID, VERSION)"};
public static String[] CREATE_ITEMS_SQL_INT_ANSI_SQL =
@@ -86,7 +83,6 @@
+ "CONSTRAINT JCR_PK_MITEM_N PRIMARY KEY(ID), "
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM_N(ID) " + ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, ID, VERSION)"};
public static String[] CREATE_ITEMS_SQL_BIGINT_ANSI_SQL =
@@ -99,7 +95,6 @@
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID1, PARENT_ID2) REFERENCES JCR_MITEM_N(ID1, ID2) "
+ ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID1, PARENT_ID2, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID1, PARENT_ID2, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID1, PARENT_ID2, ID1, ID2, VERSION)"};
public static String[] CREATE_ITEMS_SQL_BIGINT_ORACLE =
@@ -112,7 +107,6 @@
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID1, PARENT_ID2) REFERENCES JCR_MITEM_N(ID1, ID2) "
+ ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID1, PARENT_ID2, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID1, PARENT_ID2, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID1, PARENT_ID2, ID1, ID2, VERSION)"};
public static String[] CREATE_ITEMS_SQL_VARCHAR_ANSI_SQL =
@@ -123,7 +117,6 @@
+ "CONSTRAINT JCR_PK_MITEM_N PRIMARY KEY(ID), "
+ "CONSTRAINT JCR_FK_MITEM_PARENT_N FOREIGN KEY(PARENT_ID) REFERENCES JCR_MITEM_N(ID) " + ")",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_N ON JCR_MITEM_N(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION)",
- "CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_NAME_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, NAME, I_INDEX, VERSION)",
"CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID_N ON JCR_MITEM_N(I_CLASS, PARENT_ID, ID, VERSION)"};
public static String[] DROP_ITEMS_SQL_ANSI_SQL = {"DROP TABLE JCR_MITEM_N"};
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2012-01-04 12:52:43 UTC (rev 5421)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2012-01-04 14:22:16 UTC (rev 5422)
@@ -402,7 +402,6 @@
<programlisting>ANALYZE INDEX JCR_PK_SITEM COMPUTE STATISTICS
ANALYZE INDEX JCR_IDX_SITEM_PARENT_FK COMPUTE STATISTICS
ANALYZE INDEX JCR_IDX_SITEM_PARENT COMPUTE STATISTICS
-ANALYZE INDEX JCR_IDX_SITEM_PARENT_NAME COMPUTE STATISTICS
ANALYZE INDEX JCR_IDX_SITEM_PARENT_ID COMPUTE STATISTICS
ANALYZE INDEX JCR_PK_SVALUE COMPUTE STATISTICS
ANALYZE INDEX JCR_IDX_SVALUE_PROPERTY COMPUTE STATISTICS
14 years, 3 months
exo-jcr SVN: r5421 - in jcr/branches/1.15.x: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config and 12 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-04 07:52:43 -0500 (Wed, 04 Jan 2012)
New Revision: 5421
Modified:
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
jcr/branches/1.15.x/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java
Log:
EXOJCR-1580: Make eXo JCR supports JBoss AS7
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.jmx.MX4JComponentAdapterFactory;
@@ -288,7 +289,7 @@
workspaceContainer.registerComponentImplementation(StandaloneStoragePluginProvider.class);
try
{
- final Class<?> containerType = Class.forName(wsConfig.getContainer().getType());
+ final Class<?> containerType = ClassLoading.forName(wsConfig.getContainer().getType(), RepositoryContainer.class);
workspaceContainer.registerComponentImplementation(containerType);
if (isSystem)
{
@@ -308,7 +309,7 @@
String className = wsConfig.getCache().getType();
if (className != null && className.length() > 0)
{
- workspaceContainer.registerComponentImplementation(Class.forName(className));
+ workspaceContainer.registerComponentImplementation(ClassLoading.forName(className, RepositoryContainer.class));
}
else
workspaceContainer.registerComponentImplementation(LinkedWorkspaceStorageCacheImpl.class);
@@ -328,7 +329,7 @@
{
try
{
- final Class<?> lockManagerType = Class.forName(wsConfig.getLockManager().getType());
+ final Class<?> lockManagerType = ClassLoading.forName(wsConfig.getLockManager().getType(), RepositoryContainer.class);
workspaceContainer.registerComponentImplementation(lockManagerType);
}
catch (ClassNotFoundException e)
@@ -361,7 +362,7 @@
{
try
{
- final Class<?> am = Class.forName(wsConfig.getAccessManager().getType());
+ final Class<?> am = ClassLoading.forName(wsConfig.getAccessManager().getType(), RepositoryContainer.class);
workspaceContainer.registerComponentImplementation(am);
}
catch (ClassNotFoundException e)
@@ -378,7 +379,7 @@
// use user defined
try
{
- initilizerType = Class.forName(wsConfig.getInitializer().getType());
+ initilizerType = ClassLoading.forName(wsConfig.getInitializer().getType(), RepositoryContainer.class);
}
catch (ClassNotFoundException e)
{
@@ -629,7 +630,7 @@
}
try
{
- final Class<?> authenticationPolicyClass = Class.forName(config.getAuthenticationPolicy());
+ final Class<?> authenticationPolicyClass = ClassLoading.forName(config.getAuthenticationPolicy(), RepositoryContainer.class);
registerComponentImplementation(authenticationPolicyClass);
}
catch (ClassNotFoundException e)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.PortalContainer;
@@ -519,7 +520,7 @@
try
{
- Class<?> listenerType = Class.forName(sk.getListenerClassName());
+ Class<?> listenerType = ClassLoading.forName(sk.getListenerClassName(), this);
wc.registerComponentImplementation(listenerType);
ItemsPersistenceListener listener =
(ItemsPersistenceListener)wc.getComponentInstanceOfType(listenerType);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -20,6 +20,7 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -87,7 +88,7 @@
try
{
Class<ConfigurationPersister> configurationPersisterClass =
- (Class<ConfigurationPersister>)Class.forName(cn);
+ (Class<ConfigurationPersister>)ClassLoading.forName(cn, this);
configurationPersister = configurationPersisterClass.newInstance();
configurationPersister.init(params.getPropertiesParam("working-conf"));
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -23,6 +23,7 @@
import org.apache.lucene.search.WildcardQuery;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.management.annotations.Managed;
@@ -843,7 +844,7 @@
{
try
{
- Class<?> changesFilterClass = Class.forName(changesFilterClassName);
+ Class<?> changesFilterClass = ClassLoading.forName(changesFilterClassName, this);
// Set recoveryFilterUsed, if changes filter implements LocalIndex strategy
if (changesFilterClass != null)
{
@@ -877,7 +878,7 @@
try
{
String queryImplClassName = handler.getQueryClass();
- Object obj = Class.forName(queryImplClassName).newInstance();
+ Object obj = ClassLoading.forName(queryImplClassName, this).newInstance();
if (obj instanceof AbstractQueryImpl)
{
return (AbstractQueryImpl)obj;
@@ -945,8 +946,7 @@
if (changesFilterClassName != null)
{
changesFilterClass =
- (Class<? extends IndexerChangesFilter>)Class.forName(changesFilterClassName, true, this.getClass()
- .getClassLoader());
+ (Class<? extends IndexerChangesFilter>)ClassLoading.forName(changesFilterClassName, this);
}
Constructor<? extends IndexerChangesFilter> constuctor =
changesFilterClass.getConstructor(SearchManager.class, SearchManager.class, QueryHandlerEntry.class,
@@ -1009,7 +1009,7 @@
try
{
- Class<?> qHandlerClass = Class.forName(className, true, this.getClass().getClassLoader());
+ Class<?> qHandlerClass = ClassLoading.forName(className, this);
try
{
// We first try a constructor with the workspace id
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -17,6 +17,7 @@
package org.exoplatform.services.jcr.impl.core.query.lucene;
import org.apache.lucene.analysis.Analyzer;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.core.NamespaceAccessor;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.dataflow.ItemDataConsumer;
@@ -151,7 +152,7 @@
String analyzerClassName = analyzerNode.getAttributes().getNamedItem("class").getNodeValue();
try
{
- Class clazz = Class.forName(analyzerClassName);
+ Class<?> clazz = ClassLoading.forName(analyzerClassName, this);
if (clazz == JcrStandartAnalyzer.class)
{
log.warn("Not allowed to configure " + JcrStandartAnalyzer.class.getName()
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -38,6 +38,7 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.document.DocumentReaderService;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
@@ -770,8 +771,7 @@
try
{
filterClass =
- (Class<? extends AbstractRecoveryFilter>)Class.forName(recoveryFilterClassName, true, this.getClass()
- .getClassLoader());
+ (Class<? extends AbstractRecoveryFilter>)ClassLoading.forName(recoveryFilterClassName, this);
Constructor<? extends AbstractRecoveryFilter> constuctor = filterClass.getConstructor(SearchIndex.class);
filter = constuctor.newInstance(this);
recoveryFilters.add(filter);
@@ -1738,7 +1738,7 @@
{
try
{
- Class clazz = Class.forName(directoryManagerClass);
+ Class<?> clazz = ClassLoading.forName(directoryManagerClass, this);
if (!DirectoryManager.class.isAssignableFrom(clazz))
{
throw new IOException(directoryManagerClass + " is not a DirectoryManager implementation");
@@ -2369,7 +2369,7 @@
{
try
{
- Class<?> analyzerClass = Class.forName(analyzerClassName);
+ Class<?> analyzerClass = ClassLoading.forName(analyzerClassName, this);
analyzer.setDefaultAnalyzer((Analyzer)analyzerClass.newInstance());
}
catch (Exception e)
@@ -2718,7 +2718,7 @@
{
try
{
- Class clazz = Class.forName(className);
+ Class clazz = ClassLoading.forName(className, this);
if (ExcerptProvider.class.isAssignableFrom(clazz))
{
excerptProviderClass = clazz;
@@ -2776,7 +2776,7 @@
{
try
{
- Class clazz = Class.forName(className);
+ Class clazz = ClassLoading.forName(className, this);
if (IndexingConfiguration.class.isAssignableFrom(clazz))
{
indexingConfigurationClass = clazz;
@@ -2812,7 +2812,7 @@
{
try
{
- Class clazz = Class.forName(className);
+ Class clazz = ClassLoading.forName(className, this);
if (SynonymProvider.class.isAssignableFrom(clazz))
{
synonymProviderClass = clazz;
@@ -2856,7 +2856,7 @@
{
try
{
- Class clazz = Class.forName(className);
+ Class clazz = ClassLoading.forName(className, this);
if (SpellChecker.class.isAssignableFrom(clazz))
{
spellCheckerClass = clazz;
@@ -2959,7 +2959,7 @@
{
try
{
- Class<?> similarityClass = Class.forName(className);
+ Class<?> similarityClass = ClassLoading.forName(className, this);
similarity = (Similarity)similarityClass.newInstance();
}
catch (Exception e)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.ext.action;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.services.command.action.Action;
import org.exoplatform.services.command.action.ActionCatalog;
@@ -72,7 +73,7 @@
new SessionEventMatcher(getEventTypes(ac.getEventTypes()), getPaths(ac.getPath()), ac.isDeep(),
getWorkspaces(ac.getWorkspace()), getNames(ac.getNodeTypes()), typeDataManager);
- Action action = (Action)Class.forName(ac.getActionClassName()).newInstance();
+ Action action = (Action)ClassLoading.forName(ac.getActionClassName(), this).newInstance();
addAction(matcher, action);
}
catch (Exception e)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -171,7 +172,7 @@
try
{
- Class.forName(dbDriver).newInstance();
+ ClassLoading.forName(dbDriver, this).newInstance();
}
catch (InstantiationException e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -116,8 +117,8 @@
Object cds = null;
try
{
- Class cdsClass = OracleConnectionFactory.class.getClassLoader().loadClass("oracle.jdbc.pool.OracleDataSource");
- Constructor cdsConstructor = cdsClass.getConstructor(new Class[]{});
+ Class<?> cdsClass = ClassLoading.loadClass("oracle.jdbc.pool.OracleDataSource", this);
+ Constructor<?> cdsConstructor = cdsClass.getConstructor(new Class[]{});
cds = cdsConstructor.newInstance(new Object[]{});
// set cache properties
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -111,9 +112,8 @@
Object cpool = null;
try
{
- Class cpoolClass =
- OraclePoolConnectionFactory.class.getClassLoader().loadClass("oracle.jdbc.pool.OracleOCIConnectionPool");
- Constructor cpoolConstructor =
+ Class<?> cpoolClass = ClassLoading.loadClass("oracle.jdbc.pool.OracleOCIConnectionPool", this);
+ Constructor<?> cpoolConstructor =
cpoolClass.getConstructor(new Class[]{String.class, String.class, String.class, Properties.class});
cpool = cpoolConstructor.newInstance(new Object[]{this.dbUserName, this.dbPassword, this.dbUrl, null});
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.storage.jdbc.db.GenericConnectionFactory;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
@@ -136,7 +137,7 @@
try
{
- Class.forName(dbDriver).newInstance();
+ ClassLoading.forName(dbDriver, this).newInstance();
}
catch (InstantiationException e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -118,8 +119,8 @@
Object cds = null;
try
{
- Class cdsClass = OracleConnectionFactory.class.getClassLoader().loadClass("oracle.jdbc.pool.OracleDataSource");
- Constructor cdsConstructor = cdsClass.getConstructor(new Class[]{});
+ Class<?> cdsClass = ClassLoading.loadClass("oracle.jdbc.pool.OracleDataSource", this);
+ Constructor<?> cdsConstructor = cdsClass.getConstructor(new Class[]{});
cds = cdsConstructor.newInstance(new Object[]{});
// set cache properties
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -111,9 +112,8 @@
Object cpool = null;
try
{
- Class cpoolClass =
- OraclePoolConnectionFactory.class.getClassLoader().loadClass("oracle.jdbc.pool.OracleOCIConnectionPool");
- Constructor cpoolConstructor =
+ Class<?> cpoolClass = ClassLoading.loadClass("oracle.jdbc.pool.OracleOCIConnectionPool", this);
+ Constructor<?> cpoolConstructor =
cpoolClass.getConstructor(new Class[]{String.class, String.class, String.class, Properties.class});
cpool = cpoolConstructor.newInstance(new Object[]{this.dbUserName, this.dbPassword, this.dbUrl, null});
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.value;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
import org.exoplatform.services.jcr.config.ValueStorageEntry;
@@ -97,7 +98,7 @@
try
{
o =
- Class.forName(storageEntry.getType()).getConstructor(FileCleaner.class)
+ ClassLoading.forName(storageEntry.getType(), this).getConstructor(FileCleaner.class)
.newInstance(holder.getFileCleaner());
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.value.fs;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHolder;
import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAddressStorage;
@@ -58,7 +59,7 @@
// get other vcas specific props and make VCAS
try
{
- vcas = (ValueContentAddressStorage)Class.forName(vcasType).newInstance();
+ vcas = (ValueContentAddressStorage)ClassLoading.forName(vcasType, this).newInstance();
}
catch (Exception e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.value.fs;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHolder;
import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAddressStorage;
@@ -59,7 +60,7 @@
// get other vcas specific props and make VCAS
try
{
- vcas = (ValueContentAddressStorage)Class.forName(vcasType).newInstance();
+ vcas = (ValueContentAddressStorage)ClassLoading.forName(vcasType, this).newInstance();
}
catch (Exception e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.transaction.infinispan;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.transaction.TransactionService;
@@ -97,9 +98,6 @@
*/
private static Class<?> loadClassStrict(String classname) throws ClassNotFoundException
{
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
- return cl.loadClass(classname);
+ return ClassLoading.loadClass(classname, JBossStandaloneJTAManagerLookup.class);
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.ext.backup.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.core.ManageableRepository;
@@ -109,7 +110,7 @@
try
{
- this.fullBackup = (AbstractFullBackupJob)Class.forName(fullBackupType).newInstance();
+ this.fullBackup = (AbstractFullBackupJob)ClassLoading.forName(fullBackupType, this).newInstance();
}
catch (Exception e)
{
@@ -121,7 +122,7 @@
{
try
{
- this.incrementalBackup = (AbstractIncrementalBackupJob)Class.forName(incrementalBackupType).newInstance();
+ this.incrementalBackup = (AbstractIncrementalBackupJob)ClassLoading.forName(incrementalBackupType, this).newInstance();
}
catch (Exception e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
@@ -719,11 +720,11 @@
try
{
- if ((Class.forName(log.getFullBackupType()).equals(FullBackupJob.class)))
+ if ((ClassLoading.forName(log.getFullBackupType(), this).equals(FullBackupJob.class)))
{
fullbackupType = log.getFullBackupType();
}
- else if ((Class.forName(log.getFullBackupType())
+ else if ((ClassLoading.forName(log.getFullBackupType(), this)
.equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
{
fullbackupType = log.getFullBackupType();
@@ -1006,7 +1007,7 @@
WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
- if ((Class.forName(fBackupType).equals(FullBackupJob.class)))
+ if ((ClassLoading.forName(fBackupType, this).equals(FullBackupJob.class)))
{
// set the initializer SysViewWorkspaceInitializer
wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName());
@@ -1016,7 +1017,7 @@
wiEntry.setParameters(wieParams);
}
- else if ((Class.forName(fBackupType)
+ else if ((ClassLoading.forName(fBackupType, this)
.equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
{
// set the initializer RdbmsWorkspaceInitializer
@@ -1679,9 +1680,9 @@
boolean isSameConfigRestore = false;
try
{
- if (Class.forName(
- workspacesMapping.get(repositoryEntry.getWorkspaceEntries().get(0).getName()).getFullBackupType()).equals(
- org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
+ if (ClassLoading.forName(
+ workspacesMapping.get(repositoryEntry.getWorkspaceEntries().get(0).getName()).getFullBackupType(), this)
+ .equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
{
String newConf = new JsonGeneratorImpl().createJsonObject(repositoryEntry).toString();
String currnetConf =
@@ -1782,7 +1783,7 @@
boolean isSameConfigRestore = false;
try
{
- if (Class.forName(log.getFullBackupType()).equals(
+ if (ClassLoading.forName(log.getFullBackupType(), this).equals(
org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
{
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -16,6 +16,7 @@
*/
package org.exoplatform.services.jcr.ext.backup.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -300,11 +301,11 @@
String fullbackupType = null;
try
{
- if ((Class.forName(systemBackupChainLog.getFullBackupType()).equals(FullBackupJob.class)))
+ if ((ClassLoading.forName(systemBackupChainLog.getFullBackupType(), this).equals(FullBackupJob.class)))
{
fullbackupType = systemBackupChainLog.getFullBackupType();
}
- else if ((Class.forName(systemBackupChainLog.getFullBackupType())
+ else if ((ClassLoading.forName(systemBackupChainLog.getFullBackupType(), this)
.equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
{
fullbackupType = systemBackupChainLog.getFullBackupType();
@@ -322,7 +323,7 @@
}
WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
- if ((Class.forName(fullbackupType).equals(FullBackupJob.class)))
+ if ((ClassLoading.forName(fullbackupType, this).equals(FullBackupJob.class)))
{
// set the initializer BackupWorkspaceInitializer
wiEntry.setType(BackupWorkspaceInitializer.class.getCanonicalName());
@@ -333,7 +334,7 @@
wiEntry.setParameters(wieParams);
}
- else if ((Class.forName(fullbackupType)
+ else if ((ClassLoading.forName(fullbackupType, this)
.equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
{
// set the initializer RdbmsBackupWorkspaceInitializer
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.ext.resource;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.datamodel.Identifier;
import java.net.MalformedURLException;
@@ -266,29 +267,7 @@
try
{
String clsName = packagePrefix + "." + JCR_SCHEME + ".Handler";
- Class<?> cls = null;
- try
- {
- cls = Class.forName(clsName);
- }
- catch (ClassNotFoundException e1)
- {
- try
- {
- // try do it with context ClassLoader
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- cls = cl.loadClass(clsName);
- }
- catch (ClassNotFoundException e2)
- {
- // last chance, try use system ClasLoader
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- if (cl != null)
- {
- cls = cl.loadClass(clsName);
- }
- }
- }
+ Class<?> cls = ClassLoading.forName(clsName, UnifiedNodeReference.class);
if (cls != null)
{
handler = (URLStreamHandler)cls.newInstance();
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.ftp.listcode;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.ftp.FtpConst;
import org.exoplatform.services.ftp.config.FtpConfig;
import org.exoplatform.services.log.ExoLogger;
@@ -47,7 +48,8 @@
{
try
{
- FtpSystemCoder coder = (FtpSystemCoder)Class.forName(availableSysemCoders[i][1]).newInstance();
+ FtpSystemCoder coder =
+ (FtpSystemCoder)ClassLoading.forName(availableSysemCoders[i][1], FtpSystemCoderManager.class).newInstance();
return coder;
}
catch (Exception exc)
Modified: jcr/branches/1.15.x/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java 2012-01-04 12:31:08 UTC (rev 5420)
+++ jcr/branches/1.15.x/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java 2012-01-04 12:52:43 UTC (rev 5421)
@@ -16,6 +16,7 @@
*/
package org.exoplatform.services.jcr.statistics;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValuesParam;
import org.exoplatform.services.log.ExoLogger;
@@ -68,7 +69,7 @@
try
{
className = (String)o;
- lTargetInterfaces.add(Class.forName(className));
+ lTargetInterfaces.add(ClassLoading.forName(className, this));
}
catch (Exception e)
{
14 years, 3 months
exo-jcr SVN: r5420 - in kernel/trunk: exo.kernel.component.ext.cache.impl.infinispan.v5 and 5 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2012-01-04 07:31:08 -0500 (Wed, 04 Jan 2012)
New Revision: 5420
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml
kernel/trunk/pom.xml
Log:
EXOJCR-1682: Improve ISPN integration to support properly the distribution mode
* Added some unit tests
* Upgraded to ISPN 5.1.0.CR2
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -24,6 +24,10 @@
<artifactId>exo.kernel.component.cache</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</dependency>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-04 12:31:08 UTC (rev 5420)
@@ -48,7 +48,6 @@
import org.infinispan.notifications.cachelistener.event.CacheEntriesEvictedEvent;
import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
-import org.infinispan.util.concurrent.locks.LockManager;
import java.io.Externalizable;
import java.io.IOException;
@@ -58,12 +57,9 @@
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -123,6 +119,14 @@
{
return cache;
}
+
+ /**
+ * @return the fullName
+ */
+ String getFullName()
+ {
+ return fullName;
+ }
/**
* {@inheritDoc}
@@ -199,9 +203,9 @@
@Override
public Void run()
{
- MapReduceTask<CacheKey<K>, V, String, CacheKey<K>> task =
- new MapReduceTask<CacheKey<K>, V, String, CacheKey<K>>(cache);
- task.mappedWith(new ClearCacheMapper<K, V>(fullName)).reducedWith(new ClearCacheReducer<String, V, K>());
+ MapReduceTask<CacheKey<K>, V, Void, Void> task =
+ new MapReduceTask<CacheKey<K>, V, Void, Void>(cache);
+ task.mappedWith(new ClearCacheMapper<K, V>(fullName)).reducedWith(new ClearCacheReducer());
task.execute();
return null;
}
@@ -1074,7 +1078,7 @@
}
}
- public static class ClearCacheMapper<K, V> extends AbstractExoCacheMapper<K, V, String, CacheKey<K>>
+ public static class ClearCacheMapper<K, V> extends AbstractExoCacheMapper<K, V, Void, Void>
{
public ClearCacheMapper()
@@ -1090,14 +1094,27 @@
* {@inheritDoc}
*/
@Override
- protected void _map(CacheKey<K> key, V value, Collector<String, CacheKey<K>> collector)
+ protected void _map(CacheKey<K> key, V value, Collector<Void, Void> collector)
{
- collector.emit("keys", key);
+ ExoContainer container = ExoContainerContext.getTopContainer();
+ if (container == null)
+ {
+ LOG.error("The top container could not be found");
+ return;
+ }
+ DistributedCacheManager dcm =
+ (DistributedCacheManager)container.getComponentInstanceOfType(DistributedCacheManager.class);
+ if (dcm == null)
+ {
+ LOG.error("The DistributedCacheManager could not be found at top container level, please configure it.");
+ return;
+ }
+ Cache<CacheKey<K>, V> cache = dcm.getCache(CACHE_NAME);
+ cache.getAdvancedCache().withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.FAIL_SILENTLY).remove(key);
}
-
}
- public static class ClearCacheReducer<K, V, KIn> implements Reducer<K, CacheKey<KIn>>
+ public static class ClearCacheReducer implements Reducer<Void, Void>
{
/**
@@ -1109,46 +1126,8 @@
* @see org.infinispan.distexec.mapreduce.Reducer#reduce(java.lang.Object, java.util.Iterator)
*/
@Override
- public CacheKey<KIn> reduce(K reducedKey, Iterator<CacheKey<KIn>> iter)
+ public Void reduce(Void reducedKey, Iterator<Void> iter)
{
- CacheKey<KIn> firstKey;
- if (iter == null || !iter.hasNext() || (firstKey = iter.next()) == null)
- {
- return null;
- }
- ExoContainer container = ExoContainerContext.getTopContainer();
- if (container == null)
- {
- LOG.error("The top container could not be found");
- return null;
- }
- DistributedCacheManager dcm =
- (DistributedCacheManager)container.getComponentInstanceOfType(DistributedCacheManager.class);
- if (dcm == null)
- {
- LOG.error("The DistributedCacheManager could not be found at top container level, please configure it.");
- return null;
- }
- Cache<CacheKey<K>, V> cache = dcm.getCache(CACHE_NAME);
- final LockManager lm = cache.getAdvancedCache().getLockManager();
- // Sort the keys to prevent deadlocks
- Set<CacheKey<KIn>> keys = new TreeSet<CacheKey<KIn>>(new Comparator<CacheKey<KIn>>()
- {
- public int compare(CacheKey<KIn> o1, CacheKey<KIn> o2)
- {
- int result = lm.getLockId(o1) - lm.getLockId(o2);
- return result == 0 ? System.identityHashCode(o1) - System.identityHashCode(o2) : result;
- }
- });
- keys.add(firstKey);
- while (iter.hasNext())
- {
- keys.add(iter.next());
- }
- for (CacheKey<KIn> key : keys)
- {
- cache.getAdvancedCache().withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.FAIL_SILENTLY).remove(key);
- }
return null;
}
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java 2012-01-04 12:31:08 UTC (rev 5420)
@@ -27,7 +27,9 @@
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.TransactionService;
import org.infinispan.Cache;
+import org.infinispan.factories.ComponentRegistry;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.picocontainer.Startable;
@@ -35,6 +37,8 @@
import java.security.PrivilegedExceptionAction;
import java.util.Map;
+import javax.transaction.TransactionManager;
+
/**
* This class is used to allow to use infinispan in distribution mode with
* the ability to launch infinispan instances in standalone mode, in other
@@ -77,7 +81,7 @@
public DistributedCacheManager(String configurationFile, Map<String, String> parameters,
ConfigurationManager configManager)
{
- this.manager = init(configurationFile, parameters, configManager);
+ this.manager = init(configurationFile, parameters, configManager, null);
}
/**
@@ -85,13 +89,23 @@
*/
public DistributedCacheManager(InitParams params, ConfigurationManager configManager)
{
+ this(params, configManager, null);
+ }
+
+ /**
+ * Default constructor
+ */
+ public DistributedCacheManager(InitParams params, ConfigurationManager configManager, TransactionService ts)
+ {
ValueParam vp;
final String result;
if (params != null && (vp = params.getValueParam(CONFIG_FILE_PARAMETER_NAME)) != null
&& (result = vp.getValue()) != null && !result.isEmpty())
{
PropertiesParam pp = params.getPropertiesParam(PARAMS_PARAMETER_NAME);
- this.manager = init(result, pp == null ? null : pp.getProperties(), configManager);
+ this.manager =
+ init(result, pp == null ? null : pp.getProperties(), configManager,
+ ts == null ? null : ts.getTransactionManager());
}
else
{
@@ -104,10 +118,11 @@
* @param configurationFile the path of the configuration file
* @param parameters the parameters to inject into the configuration file
* @param configManager the configuration manager used to get the configuration file
+ * @param tm the transaction manager
* @return the CacheManager initialized
*/
private EmbeddedCacheManager init(final String configurationFile, final Map<String, String> parameters,
- final ConfigurationManager configManager)
+ final ConfigurationManager configManager, final TransactionManager tm)
{
try
{
@@ -138,7 +153,14 @@
manager.start();
for (String cacheName : manager.getCacheNames())
{
- manager.getCache(cacheName);
+ Cache cache = manager.getCache(cacheName);
+ if (tm != null)
+ {
+ // We inject the transaction manager
+ ComponentRegistry cr = cache.getAdvancedCache().getComponentRegistry();
+ cr.registerComponent(tm, TransactionManager.class);
+ cr.rewire();
+ }
}
return manager;
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -54,7 +54,7 @@
</global>
<default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" writeSkewCheck="false" concurrencyLevel="500"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" transactionMode="TRANSACTIONAL"/>
<jmxStatistics enabled="true"/>
<invocationBatching enabled="true"/>
<clustering mode="replication">
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java 2012-01-04 12:31:08 UTC (rev 5420)
@@ -32,6 +32,9 @@
import org.exoplatform.services.cache.impl.infinispan.ExoCacheFactoryImpl;
import org.exoplatform.services.ispn.DistributedCacheManager;
import org.exoplatform.test.BasicTestCase;
+import org.infinispan.affinity.KeyAffinityService;
+import org.infinispan.affinity.KeyAffinityServiceFactory;
+import org.infinispan.affinity.KeyGenerator;
import org.infinispan.distribution.DistributionManager;
import java.io.Serializable;
@@ -42,8 +45,10 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Random;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
/**
@@ -467,17 +472,29 @@
{
private static final long serialVersionUID = 1L;
- public String value;
- public MyKey(){}
- public MyKey(String value)
+ public Object value;
+
+ public String displayValue;
+
+ public MyKey()
{
+ }
+
+ public MyKey(Object value)
+ {
this.value = value;
}
+ public MyKey(String displayValue, Object value)
+ {
+ this.displayValue = displayValue;
+ this.value = value;
+ }
+
@Override
public boolean equals(Object paramObject)
{
- return paramObject instanceof MyKey && ((MyKey)paramObject).value.endsWith(value);
+ return paramObject instanceof MyKey && ((MyKey)paramObject).value.equals(value);
}
@Override
@@ -489,10 +506,30 @@
@Override
public String toString()
{
- return value;
+ return displayValue == null ? value.toString() : displayValue;
}
}
-
+
+ public static class MyKeyGenerator implements KeyGenerator<DistributedExoCache.CacheKey<MyKey>>
+ {
+
+ public static final Random rnd = new Random();
+
+ private String fullName;
+
+ public MyKeyGenerator(String fullName)
+ {
+ this.fullName = fullName;
+ }
+
+ @Override
+ public DistributedExoCache.CacheKey<MyKey> getKey()
+ {
+ return new DistributedExoCache.CacheKey<MyKey>(fullName, new MyKey(rnd.nextLong()));
+ }
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
public void testDistributedCache() throws Exception
{
PortalContainer pc = PortalContainer.getInstance();
@@ -511,191 +548,312 @@
DistributedCacheManager dcm2 =
new DistributedCacheManager("jar:/conf/portal/distributed-cache-configuration.xml", params, cm);
- @SuppressWarnings("unchecked")
DistributedExoCache<Serializable, Object> cache1 =
(DistributedExoCache<Serializable, Object>)((ExoCacheFactory)pc
.getComponentInstanceOfType(ExoCacheFactory.class)).createCache(config);
DistributionManager dm = cache1.getCache().getDistributionManager();
- MyCacheListener listener1 = new MyCacheListener();
- cache1.addCacheListener(listener1);
DistributedExoCache<Serializable, Object> cache2 =
(DistributedExoCache<Serializable, Object>)new ExoCacheFactoryImpl(
(ExoContainerContext)pc.getComponentInstanceOfType(ExoContainerContext.class),
"jar:/conf/portal/cache-configuration-template.xml", cm, dcm2).createCache(config);
- MyCacheListener listener2 = new MyCacheListener();
- cache2.addCacheListener(listener2);
+ KeyAffinityService kas1 =
+ KeyAffinityServiceFactory.newLocalKeyAffinityService(cache1.getCache(),
+ new MyKeyGenerator(cache1.getFullName()), Executors.newSingleThreadExecutor(), 100);
+ KeyAffinityService kas2 =
+ KeyAffinityServiceFactory.newLocalKeyAffinityService(cache2.getCache(),
+ new MyKeyGenerator(cache1.getFullName()), Executors.newSingleThreadExecutor(), 100);
+
try
{
- MyKey key;
- cache1.put(key = new MyKey("a"), "b");
- assertEquals(1, cache1.getCacheSize());
- assertEquals("b", cache2.get(new MyKey("a")));
- assertEquals(1, cache2.getCacheSize());
-
-// int put1 = 1;
-// int put2 = dm.getLocality(key).isLocal() ? 0 : 1;
-//
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ Object a, b, c;
+ for (int i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ {
+ a =
+ new MyKey("a", ((DistributedExoCache.CacheKey<MyKey>)kas1.getKeyForAddress(cache1.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ else
+ {
+ a =
+ new MyKey("a", ((DistributedExoCache.CacheKey<MyKey>)kas2.getKeyForAddress(cache2.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ for (int j = 0; j < 2; j++)
+ {
+ if (j == 0)
+ {
+ b =
+ new MyKey("b", ((DistributedExoCache.CacheKey<MyKey>)kas1.getKeyForAddress(cache1.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ else
+ {
+ b =
+ new MyKey("b", ((DistributedExoCache.CacheKey<MyKey>)kas2.getKeyForAddress(cache2.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ for (int k = 0; k < 2; k++)
+ {
+ if (k == 0)
+ {
+ c =
+ new MyKey("c", ((DistributedExoCache.CacheKey<MyKey>)kas1.getKeyForAddress(cache1.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ else
+ {
+ c =
+ new MyKey("c", ((DistributedExoCache.CacheKey<MyKey>)kas2.getKeyForAddress(cache2.getCache()
+ .getRpcManager().getAddress())).getKey().value);
+ }
+ checkUseCase(cache1, cache2, dm, a, b, c);
+ }
+ }
+ }
+ }
+ finally
+ {
+ dcm2.stop();
+ }
+ }
- assertEquals(0, listener1.get);
- assertEquals(1, listener2.get);
-
- MyKey key2;
- cache2.put(key2 = new MyKey("b"), "c");
- assertEquals(2, cache1.getCacheSize());
- assertEquals(2, cache2.getCacheSize());
- assertEquals("c", cache1.get(new MyKey("b")));
-
-// put1 += dm.getLocality(key2).isLocal() ? 1 : 0;
-// put2++;
-//
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private void checkUseCase(DistributedExoCache<Serializable, Object> cache1,
+ DistributedExoCache<Serializable, Object> cache2, DistributionManager dm, Object a, Object b, Object c)
+ throws InterruptedException
+ {
+ MyCacheListener listener1 = new MyCacheListener();
+ cache1.addCacheListener(listener1);
+ MyCacheListener listener2 = new MyCacheListener();
+ cache2.addCacheListener(listener2);
+ boolean isALocal = dm.getLocality(new DistributedExoCache.CacheKey(cache1.getFullName(), new MyKey(a))).isLocal();
+ boolean isBLocal = dm.getLocality(new DistributedExoCache.CacheKey(cache1.getFullName(), new MyKey(b))).isLocal();
+ boolean isCLocal = dm.getLocality(new DistributedExoCache.CacheKey(cache1.getFullName(), new MyKey(c))).isLocal();
+ System.out.println("#####################################");
+ System.out.println("'a' is local = " + isALocal);
+ System.out.println("'b' is local = " + isBLocal);
+ System.out.println("'c' is local = " + isCLocal);
+ MyKey key = new MyKey(a);
+ cache1.put(key, "b");
+ assertEquals(1, cache1.getCacheSize());
+ assertEquals("b", cache2.get(new MyKey(a)));
+ assertEquals(1, cache2.getCacheSize());
- assertEquals(1, listener1.get);
- assertEquals(1, listener2.get);
+ int put1 = 1;
+ int put2 = isALocal ? 0 : 1;
- assertEquals(2, cache1.getCacheSize());
- assertEquals(2, cache2.getCacheSize());
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ assertEquals(0, listener1.get);
+ assertEquals(1, listener2.get);
- assertEquals(1, listener1.get);
- assertEquals(1, listener2.get);
+ MyKey key2 = new MyKey(b);
+ cache2.put(key2, "c");
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+ assertEquals("c", cache1.get(new MyKey(b)));
- cache2.put(key = new MyKey("a"), "a");
- assertEquals(2, cache1.getCacheSize());
- assertEquals(2, cache2.getCacheSize());
- assertEquals("a", cache1.get(new MyKey("a")));
-
-// put1 += dm.getLocality(key).isLocal() ? 1 : 0;
-// put2++;
-//
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ put1 += isBLocal ? 1 : 0;
+ put2++;
- assertEquals(2, listener1.get);
- assertEquals(1, listener2.get);
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
- cache2.remove(key = new MyKey("a"));
- assertEquals(1, cache1.getCacheSize());
- assertEquals(1, cache2.getCacheSize());
-
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ assertEquals(1, listener1.get);
+ assertEquals(1, listener2.get);
- assertEquals(2, listener1.get);
- assertEquals(1, listener2.get);
-
-// int remove1 = dm.getLocality(key).isLocal() ? 1 : 0;
-// int remove2 = 1;
-//
-// assertEquals(remove1, listener1.remove);
-// assertEquals(remove2, listener2.remove);
-
- cache1.put(key = new MyKey("c"), "c");
- cache1.clearCache();
- assertEquals(0, cache1.getCacheSize());
- assertNull(cache1.get(new MyKey("b")));
- assertNull(cache2.get(new MyKey("b")));
- assertNull(cache2.get(new MyKey("c")));
- assertEquals(0, cache2.getCacheSize());
-
-// put1++;
-// put2 += dm.getLocality(key).isLocal() ? 0 : 1;
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
- assertEquals(3, listener1.get);
- assertEquals(3, listener2.get);
+ assertEquals(1, listener1.get);
+ assertEquals(1, listener2.get);
-// assertEquals(remove1, listener1.remove);
-// assertEquals(remove2, listener2.remove);
+ key = new MyKey(a);
+ cache2.put(key, "a");
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+ assertEquals("a", cache1.get(new MyKey(a)));
- assertEquals(1, listener1.clearCache);
- assertEquals(0, listener2.clearCache);
+ put1 += isALocal ? 1 : 0;
+ put2++;
- Map<Serializable, Object> values = new HashMap<Serializable, Object>();
- values.put(key = new MyKey("a"), "a");
- values.put(key2 = new MyKey("b"), "b");
- cache1.putMap(values);
- assertEquals(2, cache1.getCacheSize());
- Thread.sleep(40);
- assertEquals("a", cache2.get(new MyKey("a")));
- assertEquals("b", cache2.get(new MyKey("b")));
- assertEquals(2, cache2.getCacheSize());
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
-// put1 += 2;
-// put2 += (dm.getLocality(key).isLocal() ? 0 : 1) + (dm.getLocality(key2).isLocal() ? 0 : 1);
-//
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ assertEquals(2, listener1.get);
+ assertEquals(1, listener2.get);
- assertEquals(3, listener1.get);
- assertEquals(5, listener2.get);
+ key = new MyKey(a);
+ cache2.remove(key);
+ assertEquals(1, cache1.getCacheSize());
+ assertEquals(1, cache2.getCacheSize());
-// assertEquals(remove1, listener1.remove);
-// assertEquals(remove2, listener2.remove);
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
- assertEquals(1, listener1.clearCache);
- assertEquals(0, listener2.clearCache);
+ assertEquals(2, listener1.get);
+ assertEquals(1, listener2.get);
- values = new HashMap<Serializable, Object>()
+ int remove1 = isALocal ? 1 : 0;
+ int remove2 = 1;
+
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
+
+ key = new MyKey(c);
+ cache1.put(key, "c");
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+ assertEquals("c", cache2.get(new MyKey(c)));
+
+ put1++;
+ put2 += isCLocal ? 0 : 1;
+
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
+
+ assertEquals(2, listener1.get);
+ assertEquals(2, listener2.get);
+
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
+
+ assertEquals(0, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ cache1.clearCache();
+ assertEquals(0, cache1.getCacheSize());
+ assertNull(cache1.get(new MyKey(b)));
+ assertNull(cache1.get(new MyKey(c)));
+ assertNull(cache2.get(new MyKey(b)));
+ assertNull(cache2.get(new MyKey(c)));
+ assertEquals(0, cache2.getCacheSize());
+
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
+
+ assertEquals(4, listener1.get);
+ assertEquals(4, listener2.get);
+
+ // Since the clear cache map/reduce can only find cache1,
+ // the remove calls will be applied to cache1 so cache2
+ // will be notified on its entries, this is due to the
+ // hack used to apply modifications within a map/reduce
+ remove2 += (isBLocal ? 0 : 1) + (isCLocal ? 0 : 1);
+
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ Map<Serializable, Object> values = new HashMap<Serializable, Object>();
+ key = new MyKey(a);
+ key2 = new MyKey(b);
+ values.put(key, "a");
+ values.put(key2, "b");
+ cache1.putMap(values);
+ assertEquals(2, cache1.getCacheSize());
+ Thread.sleep(40);
+ assertEquals("a", cache1.get(new MyKey(a)));
+ assertEquals("b", cache1.get(new MyKey(b)));
+ assertEquals("a", cache2.get(new MyKey(a)));
+ assertEquals("b", cache2.get(new MyKey(b)));
+ assertEquals(2, cache2.getCacheSize());
+
+ put1 += 2;
+ put2 += (isALocal ? 0 : 1) + (isBLocal ? 0 : 1);
+
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
+
+ assertEquals(6, listener1.get);
+ assertEquals(6, listener2.get);
+
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ values = new HashMap<Serializable, Object>()
+ {
+ private static final long serialVersionUID = 1L;
+
+ public Set<Entry<Serializable, Object>> entrySet()
{
- private static final long serialVersionUID = 1L;
+ Set<Entry<Serializable, Object>> set = new LinkedHashSet<Entry<Serializable, Object>>(super.entrySet());
+ set.add(new Entry<Serializable, Object>()
+ {
- public Set<Entry<Serializable, Object>> entrySet()
- {
- Set<Entry<Serializable, Object>> set = new LinkedHashSet<Entry<Serializable, Object>>(super.entrySet());
- set.add(new Entry<Serializable, Object>()
+ public Object setValue(Object paramV)
{
+ return null;
+ }
- public Object setValue(Object paramV)
- {
- return null;
- }
+ public Object getValue()
+ {
+ throw new RuntimeException("An exception");
+ }
- public Object getValue()
- {
- throw new RuntimeException("An exception");
- }
+ public Serializable getKey()
+ {
+ return "c";
+ }
+ });
+ return set;
+ }
+ };
+ values.put(new MyKey("e"), "e");
+ values.put(new MyKey("d"), "d");
+ cache1.putMap(values);
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
- public Serializable getKey()
- {
- return "c";
- }
- });
- return set;
- }
- };
- values.put(new MyKey("e"), "e");
- values.put(new MyKey("d"), "d");
- cache1.putMap(values);
- assertEquals(2, cache1.getCacheSize());
- assertEquals(2, cache2.getCacheSize());
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
-// assertEquals(put1, listener1.put);
-// assertEquals(put2, listener2.put);
+ assertEquals(6, listener1.get);
+ assertEquals(6, listener2.get);
- assertEquals(3, listener1.get);
- assertEquals(5, listener2.get);
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
-// assertEquals(remove1, listener1.remove);
-// assertEquals(remove2, listener2.remove);
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
- assertEquals(1, listener1.clearCache);
- assertEquals(0, listener2.clearCache);
+ assertEquals(0, listener1.expire);
+ assertEquals(0, listener2.expire);
- assertEquals(0, listener1.expire);
- assertEquals(0, listener2.expire);
+ cache2.clearCache();
+ assertEquals(0, cache1.getCacheSize());
+ assertEquals(0, cache2.getCacheSize());
- }
- finally
- {
- dcm2.stop();
- }
+ assertEquals(put1, listener1.put);
+ assertEquals(put2, listener2.put);
+
+ assertEquals(6, listener1.get);
+ assertEquals(6, listener2.get);
+
+ // Since the clear cache map/reduce can only find cache1,
+ // the remove calls will be applied to cache1 so cache2
+ // will be notified on its entries, this is due to the
+ // hack used to apply modifications within a map/reduce
+ remove2 += (isALocal ? 0 : 1) + (isBLocal ? 0 : 1);
+
+ assertEquals(remove1, listener1.remove);
+ assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(1, listener2.clearCache);
+
+ assertEquals(0, listener1.expire);
+ assertEquals(0, listener2.expire);
}
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -54,11 +54,12 @@
</global>
<default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" writeSkewCheck="false" concurrencyLevel="500"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" transactionMode="TRANSACTIONAL"/>
<jmxStatistics enabled="true"/>
<clustering mode="replication">
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
<sync replTimeout="20000"/>
</clustering>
+ <invocationBatching enabled="true"/>
</default>
</infinispan>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -54,11 +54,12 @@
</global>
<default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" transactionMode="TRANSACTIONAL"/>
<jmxStatistics enabled="true"/>
<clustering mode="replication">
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
<sync replTimeout="20000"/>
</clustering>
+ <invocationBatching enabled="true"/>
</default>
</infinispan>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -54,10 +54,9 @@
</global>
<namedCache name="eXoCache">
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
<jmxStatistics enabled="true"/>
<clustering mode="distribution">
- <l1 enabled="false"/>
<hash numOwners="${infinispan-num-owners}" rehashRpcTimeout="120000" />
<sync/>
</clustering>
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2012-01-04 11:48:55 UTC (rev 5419)
+++ kernel/trunk/pom.xml 2012-01-04 12:31:08 UTC (rev 5420)
@@ -213,7 +213,7 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
- <version>5.1.0.CR1</version>
+ <version>5.1.0.CR2</version>
</dependency>
<dependency>
<groupId>org.jibx</groupId>
14 years, 3 months
exo-jcr SVN: r5419 - in ws/branches/2.3.x: exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl and 3 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-04 06:48:55 -0500 (Wed, 04 Jan 2012)
New Revision: 5419
Modified:
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java
ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/DependencySupplier.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ExceptionMapperComponentPlugin.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestFilterComponentPlugin.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResponseFilterComponentPlugin.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterComponentPlugin.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/EntityProviderComponentPlugin.java
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextComponentPlugin.java
Log:
EXOJCR-1580: Make eXo JCR supports JBoss AS7
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -33,6 +33,7 @@
package org.exoplatform.common.http.client;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -429,7 +430,7 @@
try
{
String mname = list[idx];
- DefaultModuleList.addElement(Class.forName(mname));
+ DefaultModuleList.addElement(ClassLoading.forName(mname, HTTPConnection.class));
if (log.isDebugEnabled())
log.debug("added module " + list[idx]);
@@ -1924,9 +1925,9 @@
try
{
if (raw)
- removeModule(Class.forName(modules[idx]));
+ removeModule(ClassLoading.forName(modules[idx], this));
else
- addModule(Class.forName(modules[idx]), -1);
+ addModule(ClassLoading.forName(modules[idx], this), -1);
}
catch (ClassNotFoundException cnfe)
{
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -33,6 +33,7 @@
package org.exoplatform.common.http.client;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -162,7 +163,7 @@
// get the RedirectionModule class
try
{
- redir_mod = Class.forName("HTTPClient.RedirectionModule");
+ redir_mod = ClassLoading.forName("HTTPClient.RedirectionModule", HttpURLConnection.class);
}
catch (ClassNotFoundException cnfe)
{
Modified: ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
===================================================================
--- ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.ws.frameworks.json.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
@@ -487,7 +488,7 @@
case CLASS :
try
{
- return Class.forName(jsonValue.getStringValue());
+ return ClassLoading.forName(jsonValue.getStringValue(), ObjectBuilder.class);
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/DependencySupplier.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/DependencySupplier.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/DependencySupplier.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -19,6 +19,7 @@
package org.exoplatform.services.rest.impl;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
@@ -76,7 +77,7 @@
{
public Class run() throws ClassNotFoundException
{
- return Thread.currentThread().getContextClassLoader().loadClass(injectAnnotationParameter.getValue());
+ return ClassLoading.loadClass(injectAnnotationParameter.getValue(), DependencySupplier.class);
}
});
}
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ExceptionMapperComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ExceptionMapperComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ExceptionMapperComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -19,6 +19,7 @@
package org.exoplatform.services.rest.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -59,7 +60,7 @@
ValueParam v = i.next();
try
{
- emaps.add((Class<? extends ExceptionMapper<?>>)Class.forName(v.getValue()));
+ emaps.add((Class<? extends ExceptionMapper<?>>)ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestFilterComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestFilterComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestFilterComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -66,7 +67,7 @@
ValueParam v = i.next();
try
{
- fs.add((Class<? extends RequestFilter>)Class.forName(v.getValue()));
+ fs.add((Class<? extends RequestFilter>)ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResponseFilterComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResponseFilterComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResponseFilterComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -64,7 +65,7 @@
ValueParam v = i.next();
try
{
- fs.add((Class<? extends ResponseFilter>)Class.forName(v.getValue()));
+ fs.add((Class<? extends ResponseFilter>)ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -65,7 +66,7 @@
ValueParam v = i.next();
try
{
- mifs.add((Class<? extends MethodInvokerFilter>)Class.forName(v.getValue()));
+ mifs.add((Class<? extends MethodInvokerFilter>)ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/EntityProviderComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/EntityProviderComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/EntityProviderComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -61,7 +62,7 @@
ValueParam v = i.next();
try
{
- eps.add((Class<? extends EntityProvider>)Class.forName(v.getValue()));
+ eps.add((Class<? extends EntityProvider>)ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextComponentPlugin.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextComponentPlugin.java 2012-01-04 11:44:01 UTC (rev 5418)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextComponentPlugin.java 2012-01-04 11:48:55 UTC (rev 5419)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -52,7 +53,6 @@
* @param params initialize parameters
* @see InitParams
*/
- @SuppressWarnings("unchecked")
public JAXBContextComponentPlugin(InitParams params)
{
if (params != null)
@@ -63,7 +63,7 @@
ValueParam v = i.next();
try
{
- jcs.add(Class.forName(v.getValue()));
+ jcs.add(ClassLoading.forName(v.getValue(), this));
}
catch (ClassNotFoundException e)
{
14 years, 3 months
exo-jcr SVN: r5418 - in core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database: impl and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-04 06:44:01 -0500 (Wed, 04 Jan 2012)
New Revision: 5418
Modified:
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
Log:
EXOJCR-1580: Make eXo JCR supports JBoss AS7
Modified: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2012-01-04 11:37:05 UTC (rev 5417)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2012-01-04 11:44:01 UTC (rev 5418)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.database.creator;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.configuration.ConfigurationException;
@@ -480,7 +481,7 @@
Connection conn = null;
try
{
- Class.forName(connectionProperties.get(DRIVER_NAME));
+ ClassLoading.forName(connectionProperties.get(DRIVER_NAME), this);
conn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
Modified: core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
===================================================================
--- core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2012-01-04 11:37:05 UTC (rev 5417)
+++ core/branches/2.5.x/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2012-01-04 11:44:01 UTC (rev 5418)
@@ -19,6 +19,7 @@
package org.exoplatform.services.database.impl;
import org.exoplatform.commons.exception.ObjectNotFoundException;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainer;
@@ -172,7 +173,7 @@
try
{
//load driver class
- Class.forName(conf_.getProperty("hibernate.connection.driver_class")).newInstance();
+ ClassLoading.forName(conf_.getProperty("hibernate.connection.driver_class"), this).newInstance();
}
catch (InstantiationException e)
{
@@ -259,7 +260,7 @@
{
for (String annotation : annotations)
{
- Class clazz = cl.loadClass(annotation);
+ Class<?> clazz = ClassLoading.loadClass(annotation, this);
conf_.addAnnotatedClass(clazz);
}
14 years, 3 months