[hornetq-commits] JBoss hornetq SVN: r11484 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Oct 6 16:57:38 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-10-06 16:57:38 -0400 (Thu, 06 Oct 2011)
New Revision: 11484

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
Back porting HORNETQ-681

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-10-06 20:46:30 UTC (rev 11483)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-10-06 20:57:38 UTC (rev 11484)
@@ -67,7 +67,6 @@
 import org.hornetq.core.paging.impl.PagingManagerImpl;
 import org.hornetq.core.paging.impl.PagingStoreFactoryNIO;
 import org.hornetq.core.persistence.GroupingInfo;
-import org.hornetq.core.persistence.OperationContext;
 import org.hornetq.core.persistence.QueueBindingInfo;
 import org.hornetq.core.persistence.StorageManager;
 import org.hornetq.core.persistence.config.PersistedAddressSetting;
@@ -122,6 +121,7 @@
 import org.hornetq.spi.core.protocol.RemotingConnection;
 import org.hornetq.spi.core.protocol.SessionCallback;
 import org.hornetq.spi.core.security.HornetQSecurityManager;
+import org.hornetq.utils.ClassloadingUtil;
 import org.hornetq.utils.ExecutorFactory;
 import org.hornetq.utils.HornetQThreadFactory;
 import org.hornetq.utils.OrderedExecutorFactory;
@@ -1754,18 +1754,7 @@
 
    private Object instantiateInstance(final String className)
    {
-      ClassLoader loader = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Class<?> clz = loader.loadClass(className);
-         Object object = clz.newInstance();
-
-         return object;
-      }
-      catch (Exception e)
-      {
-         throw new IllegalArgumentException("Error instantiating class \"" + className + "\"", e);
-      }
+       return ClassloadingUtil.safeInitNewInstance(className);
    }
 
    private static ClassLoader getThisClassLoader()



More information about the hornetq-commits mailing list