[exo-jcr-commits] exo-jcr SVN: r5778 - in jcr/branches/1.14.6-GA-JBAS7: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config and 12 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Mar 3 07:35:20 EST 2012


Author: tolusha
Date: 2012-03-03 07:35:19 -0500 (Sat, 03 Mar 2012)
New Revision: 5778

Modified:
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
   jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java
Log:
EXOJCR-1777: applied patches

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -19,6 +19,7 @@
 package org.exoplatform.services.jcr.impl;
 
 import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.Tools;
 import org.exoplatform.container.ExoContainer;
 import org.exoplatform.container.component.ComponentPlugin;
 import org.exoplatform.container.jmx.MX4JComponentAdapterFactory;
@@ -290,7 +291,7 @@
                workspaceContainer.registerComponentImplementation(StandaloneStoragePluginProvider.class);
                try
                {
-                  final Class<?> containerType = Class.forName(wsConfig.getContainer().getType());
+                  final Class<?> containerType = Tools.forName(wsConfig.getContainer().getType(), RepositoryContainer.class);
                   workspaceContainer.registerComponentImplementation(containerType);
                   if (isSystem)
                   {
@@ -309,7 +310,7 @@
                   String className = wsConfig.getCache().getType();
                   if (className != null && className.length() > 0)
                   {
-                     workspaceContainer.registerComponentImplementation(Class.forName(className));
+                     workspaceContainer.registerComponentImplementation(Tools.forName(className, RepositoryContainer.class));
                   }
                   else
                      workspaceContainer.registerComponentImplementation(LinkedWorkspaceStorageCacheImpl.class);
@@ -330,7 +331,7 @@
                {
                   try
                   {
-                     final Class<?> lockPersister = Class.forName(wsConfig.getLockManager().getPersister().getType());
+                     final Class<?> lockPersister = Tools.forName(wsConfig.getLockManager().getPersister().getType(), RepositoryContainer.class);
                      workspaceContainer.registerComponentImplementation(lockPersister);
                   }
                   catch (ClassNotFoundException e)
@@ -345,7 +346,7 @@
                {
                   try
                   {
-                     final Class<?> lockManagerType = Class.forName(wsConfig.getLockManager().getType());
+                     final Class<?> lockManagerType = Tools.forName(wsConfig.getLockManager().getType(), RepositoryContainer.class);
                      workspaceContainer.registerComponentImplementation(lockManagerType);
                   }
                   catch (ClassNotFoundException e)
@@ -376,7 +377,7 @@
                {
                   try
                   {
-                     final Class<?> am = Class.forName(wsConfig.getAccessManager().getType());
+                     final Class<?> am = Tools.forName(wsConfig.getAccessManager().getType(), RepositoryContainer.class);
                      workspaceContainer.registerComponentImplementation(am);
                   }
                   catch (ClassNotFoundException e)
@@ -393,7 +394,7 @@
                   // use user defined
                   try
                   {
-                     initilizerType = Class.forName(wsConfig.getInitializer().getType());
+                     initilizerType = Tools.forName(wsConfig.getInitializer().getType(), RepositoryContainer.class);
                   }
                   catch (ClassNotFoundException e)
                   {
@@ -655,7 +656,7 @@
                }
                try
                {
-                  final Class<?> authenticationPolicyClass = Class.forName(config.getAuthenticationPolicy());
+                  final Class<?> authenticationPolicyClass = Tools.forName(config.getAuthenticationPolicy(), RepositoryContainer.class);
                   registerComponentImplementation(authenticationPolicyClass);
                }
                catch (ClassNotFoundException e)

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -19,6 +19,7 @@
 package org.exoplatform.services.jcr.impl;
 
 import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.forName(sk.getListenerClassName(), this);
                   wc.registerComponentImplementation(listenerType);
                   ItemsPersistenceListener listener =
                      (ItemsPersistenceListener)wc.getComponentInstanceOfType(listenerType);

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -20,6 +20,7 @@
 
 import org.exoplatform.commons.utils.PrivilegedFileHelper;
 import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.commons.utils.Tools;
 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>)Tools.forName(cn, this);
                configurationPersister = configurationPersisterClass.newInstance();
                configurationPersister.init(params.getPropertiesParam("working-conf"));
             }

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -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.Tools;
 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 = Tools.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 = Tools.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>)Tools.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 = Tools.forName(className, this);
          try
          {
             // We first try a constructor with the workspace id

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -17,6 +17,7 @@
 package org.exoplatform.services.jcr.impl.core.query.lucene;
 
 import org.apache.lucene.analysis.Analyzer;
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.forName(analyzerClassName, this);
                      if (clazz == JcrStandartAnalyzer.class)
                      {
                         log.warn("Not allowed to configure " + JcrStandartAnalyzer.class.getName()

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -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.Tools;
 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>)Tools.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 = Tools.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 = Tools.forName(analyzerClassName, this);
          analyzer.setDefaultAnalyzer((Analyzer)analyzerClass.newInstance());
       }
       catch (Exception e)
@@ -2718,7 +2718,7 @@
    {
       try
       {
-         Class clazz = Class.forName(className);
+         Class clazz = Tools.forName(className, this);
          if (ExcerptProvider.class.isAssignableFrom(clazz))
          {
             excerptProviderClass = clazz;
@@ -2776,7 +2776,7 @@
    {
       try
       {
-         Class clazz = Class.forName(className);
+         Class clazz = Tools.forName(className, this);
          if (IndexingConfiguration.class.isAssignableFrom(clazz))
          {
             indexingConfigurationClass = clazz;
@@ -2812,7 +2812,7 @@
    {
       try
       {
-         Class clazz = Class.forName(className);
+         Class clazz = Tools.forName(className, this);
          if (SynonymProvider.class.isAssignableFrom(clazz))
          {
             synonymProviderClass = clazz;
@@ -2856,7 +2856,7 @@
    {
       try
       {
-         Class clazz = Class.forName(className);
+         Class clazz = Tools.forName(className, this);
          if (SpellChecker.class.isAssignableFrom(clazz))
          {
             spellCheckerClass = clazz;
@@ -2959,7 +2959,7 @@
    {
       try
       {
-         Class<?> similarityClass = Class.forName(className);
+         Class<?> similarityClass = Tools.forName(className, this);
          similarity = (Similarity)similarityClass.newInstance();
       }
       catch (Exception e)

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.ext.action;
 
+import org.exoplatform.commons.utils.Tools;
 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)Tools.forName(ac.getActionClassName(), this).newInstance();
                addAction(matcher, action);
             }
             catch (Exception e)

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.db;
 
+import org.exoplatform.commons.utils.Tools;
 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();
+         Tools.forName(dbDriver, this).newInstance();
       }
       catch (InstantiationException e)
       {

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OracleConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.db;
 
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.loadClass("oracle.jdbc.pool.OracleDataSource", this);
+         Constructor<?> cdsConstructor = cdsClass.getConstructor(new Class[]{});
          cds = cdsConstructor.newInstance(new Object[]{});
 
          // set cache properties

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/OraclePoolConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.db;
 
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.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.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
 
+import org.exoplatform.commons.utils.Tools;
 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();
+         Tools.forName(dbDriver, this).newInstance();
       }
       catch (InstantiationException e)
       {

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
 
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.loadClass("oracle.jdbc.pool.OracleDataSource", this);
+         Constructor<?> cdsConstructor = cdsClass.getConstructor(new Class[]{});
          cds = cdsConstructor.newInstance(new Object[]{});
 
          // set cache properties

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OraclePoolConnectionFactory.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
 
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.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.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.value;
 
+import org.exoplatform.commons.utils.Tools;
 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)
+                     Tools.forName(storageEntry.getType(), this).getConstructor(FileCleaner.class)
                         .newInstance(holder.getFileCleaner());
 
                }

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.value.fs;
 
+import org.exoplatform.commons.utils.Tools;
 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)Tools.forName(vcasType, this).newInstance();
       }
       catch (Exception e)
       {

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.value.fs;
 
+import org.exoplatform.commons.utils.Tools;
 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)Tools.forName(vcasType, this).newInstance();
       }
       catch (Exception e)
       {

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.transaction.infinispan;
 
+import org.exoplatform.commons.utils.Tools;
 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 Tools.loadClass(classname, JBossStandaloneJTAManagerLookup.class);
    }
 }

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.ext.backup.impl;
 
+import org.exoplatform.commons.utils.Tools;
 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)Tools.forName(fullBackupType, this).newInstance();
       }
       catch (Exception e)
       {
@@ -121,7 +122,7 @@
       {
          try
          {
-            this.incrementalBackup = (AbstractIncrementalBackupJob)Class.forName(incrementalBackupType).newInstance();
+            this.incrementalBackup = (AbstractIncrementalBackupJob)Tools.forName(incrementalBackupType, this).newInstance();
          }
          catch (Exception e)
          {

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -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.Tools;
 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 ((Tools.forName(log.getFullBackupType(), this).equals(FullBackupJob.class)))
          {
             fullbackupType = log.getFullBackupType();
          }
-         else if ((Class.forName(log.getFullBackupType())
+         else if ((Tools.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 ((Tools.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 ((Tools.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 (Tools.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 (Tools.forName(log.getFullBackupType(), this).equals(
             org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
          {
 

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -16,6 +16,7 @@
  */
 package org.exoplatform.services.jcr.ext.backup.impl;
 
+import org.exoplatform.commons.utils.Tools;
 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 ((Tools.forName(systemBackupChainLog.getFullBackupType(), this).equals(FullBackupJob.class)))
          {
             fullbackupType = systemBackupChainLog.getFullBackupType();
          }
-         else if ((Class.forName(systemBackupChainLog.getFullBackupType())
+         else if ((Tools.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 ((Tools.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 ((Tools.forName(fullbackupType, this)
                .equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
       {
          // set the initializer RdbmsBackupWorkspaceInitializer

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -19,6 +19,7 @@
 package org.exoplatform.services.jcr.ext.resource;
 
 import org.exoplatform.commons.utils.PrivilegedSystemHelper;
+import org.exoplatform.commons.utils.Tools;
 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 = Tools.forName(clsName, UnifiedNodeReference.class);
             if (cls != null)
             {
                handler = (URLStreamHandler)cls.newInstance();

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.ftp.listcode;
 
+import org.exoplatform.commons.utils.Tools;
 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)Tools.forName(availableSysemCoders[i][1], FtpSystemCoderManager.class).newInstance();
                return coder;
             }
             catch (Exception exc)

Modified: jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java
===================================================================
--- jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java	2012-03-03 12:31:37 UTC (rev 5777)
+++ jcr/branches/1.14.6-GA-JBAS7/exo.jcr.component.statistics/src/main/java/org/exoplatform/services/jcr/statistics/JCRAPIAspectConfig.java	2012-03-03 12:35:19 UTC (rev 5778)
@@ -16,6 +16,7 @@
  */
 package org.exoplatform.services.jcr.statistics;
 
+import org.exoplatform.commons.utils.Tools;
 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(Tools.forName(className, this));
             }
             catch (Exception e)
             {



More information about the exo-jcr-commits mailing list