JBoss hornetq SVN: r11703 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:45:41 -0500 (Fri, 18 Nov 2011)
New Revision: 11703
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
HORNETQ-761 Fix NPE in case of race between multiple calls to stop()
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-18 10:45:26 UTC (rev 11702)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-18 10:45:41 UTC (rev 11703)
@@ -577,36 +577,39 @@
postOffice.stop();
}
- List<Runnable> tasks = scheduledPool.shutdownNow();
+ if (scheduledPool != null)
+ {
+ List<Runnable> tasks = scheduledPool.shutdownNow();
+ for (Runnable task : tasks)
+ {
+ HornetQServerImpl.log.info(this + "::Waiting for " + task);
+ }
+ }
- for (Runnable task : tasks)
- {
- HornetQServerImpl.log.info(this + "::Waiting for " + task);
- }
-
if (memoryManager != null)
{
memoryManager.stop();
}
- threadPool.shutdown();
- scheduledPool.shutdown();
-
- try
- {
- if (!threadPool.awaitTermination(10, TimeUnit.SECONDS))
+ if (threadPool != null)
{
- HornetQServerImpl.log.warn("Timed out waiting for pool to terminate");
+ threadPool.shutdown();
+ try
+ {
+ if (!threadPool.awaitTermination(10, TimeUnit.SECONDS))
+ {
+ HornetQServerImpl.log.warn("Timed out waiting for pool to terminate");
+ }
+ }
+ catch (InterruptedException e)
+ {
+ // Ignore
+ }
+ threadPool = null;
}
- }
- catch (InterruptedException e)
- {
- // Ignore
- }
- threadPool = null;
- try
+ try
{
if (!scheduledPool.awaitTermination(10, TimeUnit.SECONDS))
{
@@ -621,7 +624,6 @@
securityStore.stop();
threadPool = null;
-
scheduledPool = null;
pagingManager = null;
13 years, 1 month
JBoss hornetq SVN: r11702 - in trunk: hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra and 2 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:45:26 -0500 (Fri, 18 Nov 2011)
New Revision: 11702
Modified:
trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/recovery/HornetQXAResourceWrapper.java
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/JMSTest.java
trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/SelectorTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
Log:
Remove unused imports.
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/recovery/HornetQXAResourceWrapper.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/recovery/HornetQXAResourceWrapper.java 2011-11-18 10:44:52 UTC (rev 11701)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/recovery/HornetQXAResourceWrapper.java 2011-11-18 10:45:26 UTC (rev 11702)
@@ -13,17 +13,13 @@
package org.hornetq.jms.server.recovery;
-import java.util.Map;
-
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.logging.Logger;
@@ -58,7 +54,7 @@
private XAResource delegate;
- private XARecoveryConfig[] xaRecoveryConfigs;
+ private final XARecoveryConfig[] xaRecoveryConfigs;
//private TransportConfiguration currentConnection;
Modified: trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
===================================================================
--- trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2011-11-18 10:44:52 UTC (rev 11701)
+++ trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2011-11-18 10:45:26 UTC (rev 11702)
@@ -15,7 +15,6 @@
import java.io.PrintWriter;
import java.util.Iterator;
-import java.util.List;
import java.util.Set;
import javax.jms.ConnectionMetaData;
Modified: trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/JMSTest.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/JMSTest.java 2011-11-18 10:44:52 UTC (rev 11701)
+++ trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/JMSTest.java 2011-11-18 10:45:26 UTC (rev 11702)
@@ -1,18 +1,11 @@
package org.hornetq.rest.test;
-import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.client.HornetQDestination;
-import org.hornetq.jms.client.HornetQJMSConnectionFactory;
-import org.hornetq.rest.HttpHeaderProperty;
-import org.hornetq.rest.Jms;
-import org.hornetq.rest.queue.QueueDeployment;
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.spi.Link;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.jboss.resteasy.test.TestPortProvider.generateURL;
+import java.io.Serializable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@@ -23,11 +16,18 @@
import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import static org.jboss.resteasy.test.TestPortProvider.*;
+import org.hornetq.jms.client.HornetQDestination;
+import org.hornetq.jms.client.HornetQJMSConnectionFactory;
+import org.hornetq.rest.HttpHeaderProperty;
+import org.hornetq.rest.Jms;
+import org.hornetq.rest.queue.QueueDeployment;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -46,6 +46,7 @@
@XmlRootElement
public static class Order implements Serializable
{
+ private static final long serialVersionUID = 1397854679589606480L;
private String name;
private String amount;
Modified: trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/SelectorTest.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/SelectorTest.java 2011-11-18 10:44:52 UTC (rev 11701)
+++ trunk/hornetq-rest/hornetq-rest/src/test/java/org/hornetq/rest/test/SelectorTest.java 2011-11-18 10:45:26 UTC (rev 11702)
@@ -1,6 +1,19 @@
package org.hornetq.rest.test;
-import org.hornetq.jms.client.HornetQConnectionFactory;
+import static org.jboss.resteasy.test.TestPortProvider.generateURL;
+
+import java.io.Serializable;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.xml.bind.annotation.XmlRootElement;
+
import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.HornetQJMSConnectionFactory;
import org.hornetq.rest.HttpHeaderProperty;
@@ -14,19 +27,6 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-
-import static org.jboss.resteasy.test.TestPortProvider.*;
-
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
@@ -157,7 +157,7 @@
@Path("two")
public void two(Order order)
{
- twoOrder = order;
+ twoOrder = order;
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-11-18 10:44:52 UTC (rev 11701)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-11-18 10:45:26 UTC (rev 11702)
@@ -20,6 +20,7 @@
import java.util.concurrent.TimeUnit;
import junit.framework.Assert;
+
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
@@ -32,7 +33,6 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
import org.hornetq.core.client.impl.ServerLocatorImpl;
-import org.hornetq.core.client.impl.ServerLocatorInternal;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.jms.client.HornetQTextMessage;
13 years, 1 month
JBoss hornetq SVN: r11701 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:44:52 -0500 (Fri, 18 Nov 2011)
New Revision: 11701
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java
Log:
Fix test relying on default password
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java 2011-11-18 10:44:37 UTC (rev 11700)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java 2011-11-18 10:44:52 UTC (rev 11701)
@@ -28,16 +28,6 @@
public class SecurityManagementWithDefaultConfigurationTest extends SecurityManagementTestBase
{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
public void testSendManagementMessageWithDefaultClusterAdminUser() throws Exception
{
doSendManagementMessage(ConfigurationImpl.DEFAULT_CLUSTER_USER,
@@ -63,6 +53,7 @@
protected HornetQServer setupAndStartHornetQServer() throws Exception
{
Configuration conf = createBasicConfig();
+ conf.setClusterPassword(ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD);
conf.setSecurityEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
13 years, 1 month
JBoss hornetq SVN: r11700 - in trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration: cluster/reattach and 2 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:44:37 -0500 (Fri, 18 Nov 2011)
New Revision: 11700
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlUsingCoreTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
Log:
Improve tearDown()
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -20,8 +20,8 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
+import org.hornetq.core.client.impl.ServerLocatorImpl;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.JournalType;
@@ -37,6 +37,7 @@
// Attributes ----------------------------------------------------
private static Map<Integer, String> backups = new HashMap<Integer, String>();
+ private ClientSessionFactoryInternal sf;
// Static --------------------------------------------------------
@@ -58,13 +59,13 @@
servers.get(2).start();
servers.get(3).start();
- ServerLocator locator = getServerLocator(0);
+ locator = (ServerLocatorImpl)getServerLocator(0);
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setBlockOnAcknowledge(true);
locator.setReconnectAttempts(-1);
- ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2);
+ sf = createSessionFactoryAndWaitForTopology(locator, 2);
int backupNode;
ClientSession session = sendAndConsume(sf, true);
System.out.println("failing live node ");
@@ -94,10 +95,6 @@
backupNode = waitForNewLive(5, true, servers, 0);
assertEquals(0, backupNode);
session = sendAndConsume(sf, false);
-
- locator.close();
-
- servers.get(0).stop();
}
// Package protected ---------------------------------------------
@@ -120,12 +117,11 @@
@Override
protected void tearDown() throws Exception
{
- super.tearDown();
- // make sure
for (TestableServer testableServer : servers.values())
{
try
{
+ stopComponent(testableServer);
testableServer.destroy();
}
catch (Exception e)
@@ -133,7 +129,20 @@
e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
}
}
+ servers.clear();
+ try
+ {
+ if (sf != null)
+ {
+ sf.close();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ super.tearDown();
}
@Override
@@ -299,7 +308,6 @@
config1.getClusterConfigurations().add(ccc1);
config1.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
- System.out.println(config1.getBindingsDirectory());
config1.setBindingsDirectory(config1.getBindingsDirectory() + "_" + liveNode);
config1.setJournalDirectory(config1.getJournalDirectory() + "_" + liveNode);
config1.setPagingDirectory(config1.getPagingDirectory() + "_" + liveNode);
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -17,7 +17,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
@@ -38,6 +37,7 @@
{
protected Map<Integer, TestableServer> servers = new HashMap<Integer, TestableServer>();
+ protected ServerLocatorImpl locator;
private NodeManager nodeManager;
Logger log = Logger.getLogger(SingleLiveMultipleBackupsFailoverTest.class);
@@ -71,7 +71,7 @@
servers.get(4).start();
servers.get(5).start();
- ServerLocatorImpl locator = (ServerLocatorImpl)getServerLocator(0);
+ locator = (ServerLocatorImpl)getServerLocator(0);
Topology topology = locator.getTopology();
@@ -191,11 +191,11 @@
@Override
protected void tearDown() throws Exception
{
- for (Entry<Integer, TestableServer> entry : servers.entrySet())
+ for (TestableServer server : servers.values())
{
try
{
- entry.getValue().stop();
+ stopComponent(server);
}
catch (Exception e)
{
@@ -203,6 +203,7 @@
}
}
servers.clear();
+ closeServerLocator(locator);
super.tearDown();
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -16,12 +16,11 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServers;
/**
- *
+ *
* A MultiThreadRandomReattachTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -43,9 +42,6 @@
liveServer.start();
}
- /* (non-Javadoc)
- * @see org.hornetq.tests.integration.cluster.failover.MultiThreadRandomReattachTestBase#setBody(org.hornetq.api.core.client.ClientMessage)
- */
@Override
protected void setBody(final ClientMessage message) throws Exception
{
@@ -53,9 +49,6 @@
message.getBodyBuffer().writeBytes(new byte[250]);
}
- /* (non-Javadoc)
- * @see org.hornetq.tests.integration.cluster.failover.MultiThreadRandomReattachTestBase#checkSize(org.hornetq.api.core.client.ClientMessage)
- */
@Override
protected boolean checkSize(final ClientMessage message)
{
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -45,8 +45,8 @@
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
*
+ *
*/
public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReattachSupport
{
@@ -276,7 +276,7 @@
ClientSession session = sf.createSession(false, false, false);
session.addMetaData("someData", RandomUtil.randomString());
session.addMetaData("someData2", RandomUtil.randomString());
-
+
return session;
}
@@ -828,8 +828,8 @@
ClientSession s = sf.createSession(false, false, false);
s.addMetaData("data", RandomUtil.randomString());
-
+
final int numMessages = 100;
final int numSessions = 10;
@@ -907,8 +907,8 @@
ClientSession sessConsume = sf.createSession(false, false, false);
sessConsume.addMetaData("data", RandomUtil.randomString());
-
+
sessConsume.start();
sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
@@ -1159,7 +1159,7 @@
for (int i = 0; i < numSessions; i++)
{
ClientSession session = sf.createSession(false, false, false);
-
+
session.addMetaData("data", RandomUtil.randomString());
session.close();
@@ -1246,7 +1246,7 @@
{
return 2;
}
-
+
protected int getNumThreads()
{
return 10;
@@ -1263,10 +1263,7 @@
@Override
protected void tearDown() throws Exception
{
- if (liveServer != null && liveServer.isStarted())
- {
- liveServer.stop();
- }
+ stopComponent(liveServer);
liveServer = null;
@@ -1306,7 +1303,7 @@
@Override
protected void stop() throws Exception
{
- liveServer.stop();
+ stopComponent(liveServer);
System.gc();
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -70,7 +70,7 @@
public void destroy()
{
- if(serverProcess != null)
+ if (serverProcess != null)
{
serverProcess.destroy();
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -17,6 +17,7 @@
import junit.framework.Assert;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
@@ -25,10 +26,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.management.AcceptorControl;
import org.hornetq.api.core.management.NotificationType;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
@@ -41,7 +39,7 @@
* A AcceptorControlTest
*
* @author <a href="jmesnil(a)redhat.com">Jeff Mesnil</a>
- *
+ *
* Created 11 dec. 2008 17:38:58
*
*
@@ -49,13 +47,8 @@
public class AcceptorControlTest extends ManagementTestBase
{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(AcceptorControlTest.class);
-
- // Attributes ----------------------------------------------------
-
private HornetQServer service;
+ private ServerLocator locator;
// Static --------------------------------------------------------
@@ -98,7 +91,9 @@
// started by the server
Assert.assertTrue(acceptorControl.isStarted());
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ locator =
+ HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(
+ InVMConnectorFactory.class.getName()));
ClientSessionFactory sf = locator.createSessionFactory();
ClientSession session = sf.createSession(false, true, true);
Assert.assertNotNull(session);
@@ -113,7 +108,7 @@
sf.createSession(false, true, true);
Assert.fail("acceptor must not accept connections when stopped accepting");
}
- catch (Exception e)
+ catch (HornetQException e)
{
}
@@ -136,7 +131,7 @@
sf.createSession(false, true, true);
Assert.fail("acceptor must not accept connections when stopped accepting");
}
- catch (Exception e)
+ catch (HornetQException e)
{
}
@@ -186,11 +181,8 @@
@Override
protected void tearDown() throws Exception
{
- if (service != null)
- {
- service.stop();
- }
-
+ stopComponent(service);
+ closeServerLocator(locator);
super.tearDown();
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlUsingCoreTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlUsingCoreTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AcceptorControlUsingCoreTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -22,8 +22,6 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.management.AcceptorControl;
import org.hornetq.api.core.management.ResourceNames;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -55,7 +55,6 @@
// Attributes ----------------------------------------------------
private HornetQServer server;
-
protected ClientSession session;
private ServerLocator locator;
@@ -104,13 +103,13 @@
session.deleteQueue(anotherQueue);
}
-
+
public void testGetBindingNames() throws Exception
{
SimpleString address = RandomUtil.randomSimpleString();
SimpleString queue = RandomUtil.randomSimpleString();
String divertName = RandomUtil.randomString();
-
+
session.createQueue(address, queue, false);
AddressControl addressControl = createManagementControl(address);
@@ -122,9 +121,9 @@
bindingNames = addressControl.getBindingNames();
Assert.assertEquals(2, bindingNames.length);
-
+
session.deleteQueue(queue);
-
+
bindingNames = addressControl.getBindingNames();
assertEquals(1, bindingNames.length);
assertEquals(divertName.toString(), bindingNames[0]);
@@ -316,12 +315,12 @@
@Override
protected void tearDown() throws Exception
{
- session.close();
+ if (session != null)
+ session.close();
- locator.close();
+ closeServerLocator(locator);
+ stopComponent(server);
- server.stop();
-
server = null;
session = null;
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2011-11-18 10:44:07 UTC (rev 11699)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2011-11-18 10:44:37 UTC (rev 11700)
@@ -29,9 +29,7 @@
import org.hornetq.api.core.management.AddressControl;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.security.CheckType;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.HornetQServer;
13 years, 1 month
JBoss hornetq SVN: r11699 - in trunk: hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat and 1 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:44:07 -0500 (Fri, 18 Nov 2011)
New Revision: 11699
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
Log:
remove unused variables
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-11-18 10:43:37 UTC (rev 11698)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-11-18 10:44:07 UTC (rev 11699)
@@ -50,8 +50,6 @@
// Attributes -----------------------------------------------------------------------------------
- private final boolean trace = ClientProducerImpl.log.isTraceEnabled();
-
private final SimpleString address;
private final ClientSessionInternal session;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-11-18 10:43:37 UTC (rev 11698)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-11-18 10:44:07 UTC (rev 11699)
@@ -81,8 +81,6 @@
// Constants
// ------------------------------------------------------------------------------------
- private static final long serialVersionUID = 2512460695662741413L;
-
private static final Logger log = Logger.getLogger(ClientSessionFactoryImpl.class);
private static final boolean isTrace = ClientSessionFactoryImpl.log.isTraceEnabled();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-11-18 10:43:37 UTC (rev 11698)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-11-18 10:44:07 UTC (rev 11699)
@@ -109,8 +109,6 @@
private static final Logger log = Logger.getLogger(ClientSessionImpl.class);
- private final boolean trace = ClientSessionImpl.log.isTraceEnabled();
-
// Attributes ----------------------------------------------------------------------------
private final Map<String, String> metadata = new HashMap<String, String>();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java 2011-11-18 10:43:37 UTC (rev 11698)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java 2011-11-18 10:44:07 UTC (rev 11699)
@@ -15,7 +15,6 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.impl.PacketImpl;
/**
@@ -25,12 +24,7 @@
*/
public class CreateQueueMessage extends PacketImpl
{
- // Constants -----------------------------------------------------
- private static final Logger log = Logger.getLogger(CreateQueueMessage.class);
-
- // Attributes ----------------------------------------------------
-
private SimpleString address;
private SimpleString queueName;
@@ -43,10 +37,6 @@
private boolean requiresResponse;
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
public CreateQueueMessage(final SimpleString address,
final SimpleString queueName,
final SimpleString filterString,
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-11-18 10:43:37 UTC (rev 11698)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-11-18 10:44:07 UTC (rev 11699)
@@ -19,7 +19,6 @@
import org.hornetq.api.core.Interceptor;
import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.cluster.impl.ClusterManagerImpl;
import org.hornetq.tests.util.CountDownSessionFailureListener;
@@ -31,8 +30,6 @@
*/
public class SameProcessHornetQServer implements TestableServer
{
- private static Logger log = Logger.getLogger(SameProcessHornetQServer.class);
-
private final HornetQServer server;
public SameProcessHornetQServer(HornetQServer server)
13 years, 1 month
JBoss hornetq SVN: r11698 - trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:43:37 -0500 (Fri, 18 Nov 2011)
New Revision: 11698
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
Log:
throw correct Java exception.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-11-18 10:43:18 UTC (rev 11697)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-11-18 10:43:37 UTC (rev 11698)
@@ -17,6 +17,7 @@
import java.io.PrintStream;
import java.nio.ByteBuffer;
import java.security.AccessController;
+import java.security.InvalidParameterException;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
@@ -185,7 +186,7 @@
return MESSAGES;
if (BINDINGS.typeByte == type)
return BINDINGS;
- throw new RuntimeException("invalid byte");
+ throw new InvalidParameterException("invalid byte: " + type);
}
}
13 years, 1 month
JBoss hornetq SVN: r11697 - in trunk: hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl and 3 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-18 05:43:18 -0500 (Fri, 18 Nov 2011)
New Revision: 11697
Added:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationFailedMessage.java
Modified:
trunk/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQException.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
HORNETQ-720 HORNETQ-768 Stop backup if replication registration at live failed.
Modified: trunk/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQException.java
===================================================================
--- trunk/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQException.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQException.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -136,11 +136,11 @@
/**
- * A Session Metadata was set in duplication
+ * A Session Metadata was set in duplication
*/
public static final int DUPLICATE_METADATA = 114;
-
+
// Native Error codes ----------------------------------------------
/**
@@ -193,6 +193,8 @@
*/
public static final int NATIVE_ERROR_AIO_FULL = 211;
+ public static final int ALREADY_REPLICATING = 212;
+
private int code;
public HornetQException()
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -17,8 +17,10 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
@@ -32,6 +34,7 @@
import org.hornetq.core.protocol.core.Packet;
import org.hornetq.core.protocol.core.ServerSessionPacketHandler;
import org.hornetq.core.protocol.core.impl.ChannelImpl.CHANNEL_ID;
+import org.hornetq.core.protocol.core.impl.wireformat.BackupRegistrationFailedMessage;
import org.hornetq.core.protocol.core.impl.wireformat.BackupRegistrationMessage;
import org.hornetq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage;
import org.hornetq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V2;
@@ -208,11 +211,34 @@
} else if (packet.getType() == PacketImpl.BACKUP_REGISTRATION)
{
BackupRegistrationMessage msg = (BackupRegistrationMessage)packet;
- if (server.startReplication(rc, acceptorUsed.getClusterConnection(), getPair(msg.getConnector(), true)))
- {
- // XXX if it fails, the backup should get to know it
+
+ try {
+ server.startReplication(rc, acceptorUsed.getClusterConnection(), getPair(msg.getConnector(), true));
+ } catch (HornetQException e){
+ channel0.send(new BackupRegistrationFailedMessage(e));
}
}
+ else if (packet.getType() == PacketImpl.BACKUP_REGISTRATION_FAILED)
+ {
+ assert server.getConfiguration().isBackup();
+ assert !server.getConfiguration().isSharedStore();
+ log.warn("Replication failed to start because of exception with error " +
+ ((BackupRegistrationFailedMessage)packet).getCause());
+ Executors.newSingleThreadExecutor().execute(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ server.stop();
+ }
+ catch (Exception e)
+ {
+ log.error("Error while stopping server: " + server, e);
+ }
+ }
+ });
+ }
}
private Pair<TransportConfiguration, TransportConfiguration> getPair(TransportConfiguration conn,
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketImpl.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketImpl.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -147,7 +147,7 @@
public static final byte SESS_PRODUCER_REQUEST_CREDITS = 79;
public static final byte SESS_PRODUCER_CREDITS = 80;
-
+
public static final byte SESS_INDIVIDUAL_ACKNOWLEDGE = 81;
// Replication
@@ -179,15 +179,15 @@
public static final byte REPLICATION_COMPARE_DATA = 102;
public static final byte REPLICATION_SYNC_FILE = 103;
-
+
public static final byte SESS_ADD_METADATA = 104;
-
+
public static final byte SESS_ADD_METADATA2 = 105;
-
+
public static final byte SESS_UNIQUE_ADD_METADATA = 106;
-
-
+
+
// HA
public static final byte CLUSTER_TOPOLOGY = 110;
@@ -195,7 +195,7 @@
public static final byte NODE_ANNOUNCE = 111;
public static final byte SUBSCRIBE_TOPOLOGY = 112;
-
+
// For newer versions
public static final byte SUBSCRIBE_TOPOLOGY_V2 = 113;
@@ -203,9 +203,10 @@
public static final byte CLUSTER_TOPOLOGY_V2 = 114;
public static final byte BACKUP_REGISTRATION = 115;
+ public static final byte BACKUP_REGISTRATION_FAILED = 116;
public static final byte REPLICATION_START_FINISH_SYNC = 120;
-
+
// Static --------------------------------------------------------
public PacketImpl(final byte type)
@@ -288,7 +289,7 @@
{
return true;
}
-
+
public boolean isAsyncExec()
{
return false;
Added: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationFailedMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationFailedMessage.java (rev 0)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationFailedMessage.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -0,0 +1,40 @@
+/**
+ *
+ */
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * Informs the Backup trying to start replicating of an error.
+ */
+public final class BackupRegistrationFailedMessage extends PacketImpl
+{
+
+ int errorCode;
+
+ public BackupRegistrationFailedMessage(HornetQException e)
+ {
+ super(BACKUP_REGISTRATION_FAILED);
+ errorCode = e.getCode();
+ }
+
+ public int getCause()
+ {
+ return errorCode;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(errorCode);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ errorCode = buffer.readInt();
+ }
+}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -13,7 +13,7 @@
* After registration the live server will initiate synchronization of its state with the new backup
* node.
*/
-public class BackupRegistrationMessage extends PacketImpl
+public final class BackupRegistrationMessage extends PacketImpl
{
private TransportConfiguration connector;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -17,6 +17,7 @@
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
@@ -185,8 +186,8 @@
* @param rc
* @param pair
* @param clusterConnection
- * @return {@code true} if replication started successfully, {@code false} otherwise
+ * @throws HornetQException
*/
- boolean startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
- Pair<TransportConfiguration, TransportConfiguration> pair);
+ void startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
+ Pair<TransportConfiguration, TransportConfiguration> pair) throws HornetQException;
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-15 18:14:18 UTC (rev 11696)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-18 10:43:18 UTC (rev 11697)
@@ -2256,12 +2256,12 @@
@Override
- public boolean startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
- Pair<TransportConfiguration, TransportConfiguration> pair)
+ public void startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
+ Pair<TransportConfiguration, TransportConfiguration> pair) throws HornetQException
{
if (replicationManager != null)
{
- return false;
+ throw new HornetQException(HornetQException.ALREADY_REPLICATING);
}
replicationManager = new ReplicationManagerImpl(rc, executorFactory);
@@ -2270,7 +2270,6 @@
replicationManager.start();
storageManager.startReplication(replicationManager, pagingManager, getNodeID().toString(), clusterConnection,
pair);
- return true;
}
catch (Exception e)
{
@@ -2279,10 +2278,16 @@
* the backup, or (2) by an IO Error at the storage. If (1), we can swallow the exception
* and ignore the replication request. If (2) the live will crash shortly.
*/
- // HORNETQ-720 Need to verify whether swallowing the exception here is acceptable
log.warn("Exception when trying to start replication", e);
replicationManager = null;
- return false;
+ if (e instanceof HornetQException)
+ {
+ throw (HornetQException)e;
+ }
+ else
+ {
+ throw new HornetQException(HornetQException.INTERNAL_ERROR, "Error trying to start replication", e);
+ }
}
}
13 years, 1 month
JBoss hornetq SVN: r11696 - in branches: HORNETQ-316 and 1 other directory.
by do-not-reply@jboss.org
Author: igarashitm
Date: 2011-11-15 13:14:18 -0500 (Tue, 15 Nov 2011)
New Revision: 11696
Added:
branches/HORNETQ-316/
Log:
forked from trunk for HORNETQ-316
Property changes on: branches/HORNETQ-316
___________________________________________________________________
Added: svn:ignore
+ build
eclipse-output
thirdparty
logs
ObjectStore
tmp
data
junit*.properties
target
.metadata
Added: svn:mergeinfo
+ /branches/HORNETQ-720_Replication:10878-11528
/branches/STOMP11:11225-11517
13 years, 1 month
JBoss hornetq SVN: r11695 - branches.
by do-not-reply@jboss.org
Author: igarashitm
Date: 2011-11-15 13:12:23 -0500 (Tue, 15 Nov 2011)
New Revision: 11695
Removed:
branches/HORNETQ-316/
Log:
should be forked from trunk instead of EAP branch
13 years, 1 month
JBoss hornetq SVN: r11694 - branches.
by do-not-reply@jboss.org
Author: igarashitm
Date: 2011-11-15 12:04:07 -0500 (Tue, 15 Nov 2011)
New Revision: 11694
Added:
branches/HORNETQ-316/
Log:
HORNETQ-316: forked from Branch_2_2_EAP
13 years, 1 month