JBoss hornetq SVN: r11492 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/jms/server/recovery.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-10-07 05:37:56 -0400 (Fri, 07 Oct 2011)
New Revision: 11492
Removed:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/jms/server/recovery/HornetQXAResourceRecoveryTest.java
Log:
deleted unwanted test
Deleted: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/jms/server/recovery/HornetQXAResourceRecoveryTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/jms/server/recovery/HornetQXAResourceRecoveryTest.java 2011-10-06 21:30:07 UTC (rev 11491)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/jms/server/recovery/HornetQXAResourceRecoveryTest.java 2011-10-07 09:37:56 UTC (rev 11492)
@@ -1,125 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.unit.jms.server.recovery;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
-import org.hornetq.core.remoting.impl.invm.TransportConstants;
-//import org.hornetq.jms.server.recovery.HornetQXAResourceRecovery;
-
-/**
- * A HornetQXAResourceRecoveryTest
- *
- * @AndyTaylorL please fix this test!
- *
- * @author jmesnil
- *
- *
- */
-public class HornetQXAResourceRecoveryTest extends TestCase
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
-// public void testConfigWithOnlyConnectorFactoryClassName() throws Exception
-// {
-// String config = "org.hornetq.core.remoting.impl.invm.InVMConnectorFactory";
-// HornetQXAResourceRecovery.ConfigParser parser = new HornetQXAResourceRecovery.ConfigParser(config);
-//
-// Assert.assertEquals(InVMConnectorFactory.class.getName(), parser.getConnectorFactoryClassName());
-// Assert.assertEquals(0, parser.getConnectorParameters().size());
-// Assert.assertNull(parser.getUsername());
-// Assert.assertNull(parser.getPassword());
-// }
-//
-// public void testConfigWithConnectorFactoryClassNameAndParamsWithoutUserCredentials() throws Exception
-// {
-// String config = "org.hornetq.core.remoting.impl.invm.InVMConnectorFactory, , , server-id=99";
-// HornetQXAResourceRecovery.ConfigParser parser = new HornetQXAResourceRecovery.ConfigParser(config);
-//
-// Assert.assertEquals(InVMConnectorFactory.class.getName(), parser.getConnectorFactoryClassName());
-// Assert.assertEquals(1, parser.getConnectorParameters().size());
-// Assert.assertEquals("99", parser.getConnectorParameters().get(TransportConstants.SERVER_ID_PROP_NAME));
-// Assert.assertNull(parser.getUsername());
-// Assert.assertNull(parser.getPassword());
-// }
-//
-// public void testConfigWithConnectorFactoryClassNameAndParamsAndUserCredentials() throws Exception
-// {
-// String config = "org.hornetq.core.remoting.impl.invm.InVMConnectorFactory, foo, bar, server-id=99, key=val";
-// HornetQXAResourceRecovery.ConfigParser parser = new HornetQXAResourceRecovery.ConfigParser(config);
-//
-// Assert.assertEquals(InVMConnectorFactory.class.getName(), parser.getConnectorFactoryClassName());
-// Assert.assertEquals(2, parser.getConnectorParameters().size());
-// Assert.assertEquals("99", parser.getConnectorParameters().get(TransportConstants.SERVER_ID_PROP_NAME));
-// Assert.assertEquals("val", parser.getConnectorParameters().get("key"));
-// Assert.assertEquals("foo", parser.getUsername());
-// Assert.assertEquals("bar", parser.getPassword());
-// }
-//
-// public void testConfigWithConnectorFactoryClassNameAndUserCredentialsWithoutParams() throws Exception
-// {
-// String config = "org.hornetq.core.remoting.impl.invm.InVMConnectorFactory, foo, bar";
-// HornetQXAResourceRecovery.ConfigParser parser = new HornetQXAResourceRecovery.ConfigParser(config);
-//
-// Assert.assertEquals(InVMConnectorFactory.class.getName(), parser.getConnectorFactoryClassName());
-// Assert.assertEquals(0, parser.getConnectorParameters().size());
-// Assert.assertEquals("foo", parser.getUsername());
-// Assert.assertEquals("bar", parser.getPassword());
-// }
-//
-// public void testEmptyString() throws Exception
-// {
-// try
-// {
-// String config = "";
-// new HornetQXAResourceRecovery.ConfigParser(config);
-// Assert.fail();
-// }
-// catch (IllegalArgumentException e)
-// {
-// }
-// }
-//
-// public void testUserNameWithoutPassword() throws Exception
-// {
-// try
-// {
-// String config = "org.hornetq.core.remoting.impl.invm.InVMConnectorFactory, foo";
-// new HornetQXAResourceRecovery.ConfigParser(config);
-// Assert.fail();
-// }
-// catch (IllegalArgumentException e)
-// {
-// }
-// }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
13 years, 2 months
JBoss hornetq SVN: r11490 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:09:43 -0400 (Thu, 06 Oct 2011)
New Revision: 11490
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java
Log:
"I see dead imports"
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java 2011-10-06 21:08:06 UTC (rev 11489)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java 2011-10-06 21:09:43 UTC (rev 11490)
@@ -19,10 +19,8 @@
import javax.jms.Session;
import javax.jms.TextMessage;
-import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.management.JMSQueueControl;
-import org.hornetq.core.logging.Logger;
import org.hornetq.tests.util.JMSTestBase;
/**
13 years, 2 months
JBoss hornetq SVN: r11489 - branches/Branch_2_2_EAP/src/main/org/hornetq/utils.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:08:06 -0400 (Thu, 06 Oct 2011)
New Revision: 11489
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java 2011-10-06 21:04:20 UTC (rev 11488)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java 2011-10-06 21:08:06 UTC (rev 11489)
@@ -481,7 +481,7 @@
{
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema schema = factory.newSchema(Thread.currentThread().getContextClassLoader().getResource(schemaFile));
+ Schema schema = factory.newSchema(ClassloadingUtil.findResource(schemaFile));
Validator validator = schema.newValidator();
// validate the DOM tree
13 years, 2 months
JBoss hornetq SVN: r11488 - branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/recovery.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:04:20 -0400 (Thu, 06 Oct 2011)
New Revision: 11488
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/recovery/RecoveryRegistry.java
Log:
"I see dead imports"
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/recovery/RecoveryRegistry.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/recovery/RecoveryRegistry.java 2011-10-06 21:02:52 UTC (rev 11487)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/recovery/RecoveryRegistry.java 2011-10-06 21:04:20 UTC (rev 11488)
@@ -21,8 +21,6 @@
*/
package org.hornetq.jms.server.recovery;
-import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.ra.HornetQRAConnectionFactory;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
13 years, 2 months
JBoss hornetq SVN: r11487 - branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:02:52 -0400 (Thu, 06 Oct 2011)
New Revision: 11487
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-06 21:01:08 UTC (rev 11486)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-06 21:02:52 UTC (rev 11487)
@@ -54,6 +54,7 @@
import org.hornetq.jms.bridge.QualityOfServiceMode;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.HornetQSession;
+import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -942,10 +943,8 @@
{
try
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class aClass = loader.loadClass(transactionManagerLocatorClass);
- Object o = aClass.newInstance();
- Method m = aClass.getMethod(transactionManagerLocatorMethod);
+ Object o = ClassloadingUtil.safeInitNewInstance(transactionManagerLocatorClass);
+ Method m = o.getClass().getMethod(transactionManagerLocatorMethod);
tm = (TransactionManager)m.invoke(o);
}
catch (Exception e)
13 years, 2 months
JBoss hornetq SVN: r11486 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/management/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:01:08 -0400 (Thu, 06 Oct 2011)
New Revision: 11486
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
Log:
removing dead import
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2011-10-06 20:58:53 UTC (rev 11485)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2011-10-06 21:01:08 UTC (rev 11486)
@@ -17,7 +17,6 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
13 years, 2 months
JBoss hornetq SVN: r11485 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 16:58:53 -0400 (Thu, 06 Oct 2011)
New Revision: 11485
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
Log:
tweak: removing dead code
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-10-06 20:57:38 UTC (rev 11484)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-10-06 20:58:53 UTC (rev 11485)
@@ -122,7 +122,6 @@
// The estimate of memory being consumed by this queue. Used to calculate instances of messages to depage
private final AtomicInteger queueMemorySize = new AtomicInteger(0);
- private final AtomicInteger queueInstances = new AtomicInteger(0);
private final List<ConsumerHolder> consumerList = new ArrayList<ConsumerHolder>();
@@ -462,14 +461,14 @@
{
if (isTrace)
{
- log.trace("Force delivery scheduling depage");
+ log.trace("Force delivery scheduling depage");
}
scheduleDepage();
}
if (isTrace)
{
- log.trace("Force delivery deliverying async");
+ log.trace("Force delivery deliverying async");
}
deliverAsync();
@@ -2256,7 +2255,7 @@
}
catch (Exception e)
{
- QueueImpl.log.warn("Unable to decrement reference counting", e);
+ QueueImpl.log.warn("Unable to decrement reference counting", e);
}
}
13 years, 2 months
JBoss hornetq SVN: r11484 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)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()
13 years, 2 months
JBoss hornetq SVN: r11483 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 16:46:30 -0400 (Thu, 06 Oct 2011)
New Revision: 11483
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-06 20:37:57 UTC (rev 11482)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-06 20:46:30 UTC (rev 11483)
@@ -52,6 +52,7 @@
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
+import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.ConfigurationHelper;
import org.hornetq.utils.HornetQThreadFactory;
@@ -117,13 +118,11 @@
this.clusterManager = clusterManager;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
for (String interceptorClass : config.getInterceptorClassNames())
{
try
{
- Class<?> clazz = loader.loadClass(interceptorClass);
- interceptors.add((Interceptor)clazz.newInstance());
+ interceptors.add((Interceptor) ClassloadingUtil.safeInitNewInstance(interceptorClass));
}
catch (Exception e)
{
13 years, 2 months
JBoss hornetq SVN: r11482 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 16:37:57 -0400 (Thu, 06 Oct 2011)
New Revision: 11482
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-06 20:27:03 UTC (rev 11481)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-06 20:37:57 UTC (rev 11482)
@@ -30,6 +30,8 @@
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
+import org.hornetq.utils.ClassloadingUtil;
+
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*
@@ -185,7 +187,7 @@
}
else
{
- URL url = Thread.currentThread().getContextClassLoader().getResource(storePath);
+ URL url = ClassloadingUtil.findResource(storePath);
if (url != null)
{
return url;
13 years, 2 months