JBoss hornetq SVN: r11643 - 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-11-02 16:51:25 -0400 (Wed, 02 Nov 2011)
New Revision: 11643
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
Log:
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-11-02 20:13:40 UTC (rev 11642)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-11-02 20:51:25 UTC (rev 11643)
@@ -917,6 +917,8 @@
conn.close();
server.stop();
+
+ jmsServer.stop();
}
@@ -996,6 +998,8 @@
server.stop();
+
+ jmsServer.stop();
}
12 years, 7 months
JBoss hornetq SVN: r11642 - in branches/Branch_2_2_EAP/tests/src/org/hornetq/tests: util and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-02 16:13:40 -0400 (Wed, 02 Nov 2011)
New Revision: 11642
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
Fixing windows test
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java 2011-11-02 17:18:31 UTC (rev 11641)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java 2011-11-02 20:13:40 UTC (rev 11642)
@@ -159,8 +159,10 @@
msg1.setOutputStream(output);
- msg1.waitOutputStreamCompletion(0);
+ msg1.waitOutputStreamCompletion(0);
+ output.close();
+
msg1.acknowledge();
session.commit();
@@ -176,7 +178,7 @@
byte b = (byte)input.read();
assertEquals("position = " + i, getSamplebyte(i), b);
}
-
+ input.close();
testFile.delete();
validateNoFilesOnLargeDir();
}
@@ -239,6 +241,8 @@
msg1.saveToOutputStream(output);
msg1.acknowledge();
+
+ output.close();
session.commit();
@@ -253,6 +257,7 @@
byte b = (byte)input.read();
assertEquals("position = " + i, getSamplebyte(i), b);
}
+ input.close();
testFile.delete();
validateNoFilesOnLargeDir();
@@ -358,6 +363,7 @@
byte b = (byte)input.read();
assertEquals("position = " + i, msgs[i], b);
}
+ input.close();
testFile.delete();
validateNoFilesOnLargeDir();
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02 17:18:31 UTC (rev 11641)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02 20:13:40 UTC (rev 11642)
@@ -111,8 +111,10 @@
// Attributes ----------------------------------------------------
- private static final String testDir = System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "hornetq-unit-test";
+ private final String baseDir = System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "hornetq-unit-test";
+ private final String testDir = baseDir + File.separator + System.currentTimeMillis();
+
// There is a verification about thread leakages. We only fail a single thread when this happens
private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
@@ -617,7 +619,7 @@
{
// Need to delete the root
- File file = new File(testDir);
+ File file = new File(baseDir);
deleteDirectory(file);
file.mkdirs();
@@ -627,8 +629,6 @@
recreateDirectory(getLargeMessagesDir(testDir));
recreateDirectory(getClientLargeMessagesDir(testDir));
recreateDirectory(getTemporaryDir(testDir));
-
- System.out.println("deleted " + testDir);
}
/**
@@ -899,7 +899,7 @@
OperationContextImpl.clearContext();
- deleteDirectory(new File(getTestDir()));
+ deleteDirectory(new File(baseDir));
InVMRegistry.instance.clear();
@@ -914,7 +914,10 @@
protected void tearDown() throws Exception
{
cleanupPools();
+
+ deleteDirectory(new File(baseDir));
+
Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
for (Thread thread : threadMap.keySet())
{
@@ -1162,6 +1165,11 @@
protected boolean deleteDirectory(final File directory)
{
+ if (!directory.exists())
+ {
+ return true;
+ }
+ else
if (directory.isDirectory())
{
String[] files = directory.list();
@@ -1175,8 +1183,18 @@
if (!deleteDirectory(fileTmp))
{
// This is because of Windows is dumb on releasing files
- log.warn("Couldn't delete " + fileTmp);
+ log.warn("could not delete " + fileTmp);
forceGC();
+ if (!deleteDirectory(fileTmp))
+ {
+ log.warn("**************************************************************");
+ log.warn("could not delete " + fileTmp + " even afer a retry on GC");
+ log.warn("**************************************************************");
+ }
+ else
+ {
+ log.info(fileTmp + " was deleted without a problem after a retry on GC");
+ }
return false;
}
}
12 years, 7 months
JBoss hornetq SVN: r11641 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/persistence/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-02 13:18:31 -0400 (Wed, 02 Nov 2011)
New Revision: 11641
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
Log:
fixing test on windows (leaking open file)
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java 2011-11-02 16:57:20 UTC (rev 11640)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java 2011-11-02 17:18:31 UTC (rev 11641)
@@ -127,6 +127,8 @@
Assert.assertEquals("No Ids were generated, so the currentID was supposed to stay the same",
lastId,
batch.getCurrentID());
+
+ journal.stop();
}
12 years, 7 months
JBoss hornetq SVN: r11640 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/journal/impl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-02 12:57:20 -0400 (Wed, 02 Nov 2011)
New Revision: 11640
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFile.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFile.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
Fixing the testsuite on windows
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFile.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFile.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFile.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -93,7 +93,7 @@
void renameTo(String newFileName) throws Exception;
- SequentialFile copy();
+ SequentialFile cloneFile();
void copyTo(SequentialFile newFileName) throws Exception;
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFile.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFile.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFile.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -86,7 +86,7 @@
return pos;
}
- public SequentialFile copy()
+ public SequentialFile cloneFile()
{
return new AIOSequentialFile(factory,
-1,
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -109,7 +109,10 @@
{
log.debug("Copying " + this + " as " + newFileName);
newFileName.open();
- this.open();
+ if (!isOpen())
+ {
+ this.open();
+ }
ByteBuffer buffer = ByteBuffer.allocate(10 * 1024);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -252,7 +252,7 @@
return "NIOSequentialFile " + getFile();
}
- public SequentialFile copy()
+ public SequentialFile cloneFile()
{
return new NIOSequentialFile(factory, getFile(), maxIO, writerExecutor);
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -212,7 +212,10 @@
public void open() throws Exception
{
- file.open();
+ if (!file.isOpen())
+ {
+ file.open();
+ }
size.set((int)file.size());
file.position(0);
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -383,6 +383,10 @@
log.warn("Error on copying large message this for DLA or Expiry", e);
return null;
}
+ finally
+ {
+ releaseResources();
+ }
}
}
@@ -426,7 +430,7 @@
file = storageManager.createFileForLargeMessage(getMessageID(), durable);
- file.open();
+ openFile();
bodySize = file.size();
}
@@ -437,6 +441,27 @@
throw new HornetQException(HornetQException.INTERNAL_ERROR, e.getMessage(), e);
}
}
+
+ protected void openFile() throws Exception
+ {
+ if (file == null)
+ {
+ validateFile();
+ }
+ else
+ if (!file.isOpen())
+ {
+ file.open();
+ }
+ }
+
+ protected void closeFile() throws Exception
+ {
+ if (file != null && file.isOpen())
+ {
+ file.close();
+ }
+ }
/* (non-Javadoc)
* @see org.hornetq.core.server.LargeServerMessage#setLinkedMessage(org.hornetq.core.server.LargeServerMessage)
@@ -454,9 +479,9 @@
file = storageManager.createFileForLargeMessage(message.getMessageID(), durable);
try
{
- file.open();
+ openFile();
bodySize = file.size();
- file.close();
+ closeFile();
}
catch (Exception e)
{
@@ -474,7 +499,11 @@
{
try
{
- cFile = file.copy();
+ if (cFile != null && cFile.isOpen())
+ {
+ cFile.close();
+ }
+ cFile = file.cloneFile();
cFile.open();
}
catch (Exception e)
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -121,6 +121,8 @@
protected void tearDown() throws Exception
{
locator.close();
+
+ locator = null;
super.tearDown();
}
@@ -263,7 +265,7 @@
PagingTest.PAGE_MAX,
new HashMap<String, AddressSettings>());
server.start();
-
+
waitForServer(server);
queue = server.locateQueue(ADDRESS);
@@ -647,8 +649,7 @@
PagingTest.PAGE_MAX,
new HashMap<String, AddressSettings>());
server.start();
-
-
+
locator = createInVMNonHALocator();
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
@@ -662,7 +663,7 @@
session = sf.createSession(false, false, false);
producer = session.createProducer(PagingTest.ADDRESS);
-
+
for (int i = 0; i < numberOfMessages; i++)
{
message = session.createMessage(true);
@@ -679,9 +680,9 @@
session.commit();
}
}
-
+
session.commit();
-
+
server.stop();
server = createServer(true,
@@ -696,7 +697,7 @@
queue = server.locateQueue(ADDRESS);
- // assertEquals(numberOfMessages, queue.getMessageCount());
+ // assertEquals(numberOfMessages, queue.getMessageCount());
xids = new LinkedList<Xid>();
@@ -728,7 +729,6 @@
sessionConsumer.close();
-
}
finally
{
@@ -1041,50 +1041,56 @@
server.start();
- ServerLocator locator = createInVMNonHALocator();
+ try
+ {
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnDurableSend(true);
- locator.setBlockOnAcknowledge(true);
+ ServerLocator locator = createInVMNonHALocator();
- ClientSessionFactory csf = locator.createSessionFactory();
+ locator.setBlockOnNonDurableSend(true);
+ locator.setBlockOnDurableSend(true);
+ locator.setBlockOnAcknowledge(true);
- ClientSession session = csf.createSession();
+ ClientSessionFactory csf = locator.createSessionFactory();
- session.start();
+ ClientSession session = csf.createSession();
- for (int i = 1; i <= 2; i++)
- {
- ClientConsumer cons = session.createConsumer("q" + i);
+ session.start();
- for (int j = 3; j < 6; j++)
+ for (int i = 1; i <= 2; i++)
{
- ClientMessage msg = cons.receive(5000);
+ ClientConsumer cons = session.createConsumer("q" + i);
- assertNotNull(msg);
+ for (int j = 3; j < 6; j++)
+ {
+ ClientMessage msg = cons.receive(5000);
- assertEquals("str-" + j, msg.getStringProperty("id"));
+ assertNotNull(msg);
- msg.acknowledge();
+ assertEquals("str-" + j, msg.getStringProperty("id"));
+
+ msg.acknowledge();
+ }
+
+ session.commit();
+ assertNull(cons.receive(500));
+
}
- session.commit();
- assertNull(cons.receive(500));
+ session.close();
- }
+ long timeout = System.currentTimeMillis() + 5000;
- session.close();
+ while (System.currentTimeMillis() < timeout && server.getPagingManager().getPageStore(ADDRESS).isPaging())
+ {
+ Thread.sleep(100);
+ }
- long timeout = System.currentTimeMillis() + 5000;
-
- while (System.currentTimeMillis() < timeout && server.getPagingManager().getPageStore(ADDRESS).isPaging())
+ locator.close();
+ }
+ finally
{
- Thread.sleep(100);
+ server.stop();
}
-
- locator.close();
-
- server.stop();
}
public void testTwoQueuesOneNoRouting() throws Exception
@@ -1277,27 +1283,28 @@
{
bb.put(getSamplebyte(j));
}
-
+
final AtomicBoolean running = new AtomicBoolean(true);
-
+
class TCount extends Thread
{
Queue queue;
-
+
TCount(Queue queue)
{
this.queue = queue;
}
+
public void run()
{
try
{
while (running.get())
{
- // log.info("Message count = " + queue.getMessageCount() + " on queue " + queue.getName());
+ // log.info("Message count = " + queue.getMessageCount() + " on queue " + queue.getName());
queue.getMessagesAdded();
queue.getMessageCount();
- //log.info("Message added = " + queue.getMessagesAdded() + " on queue " + queue.getName());
+ // log.info("Message added = " + queue.getMessagesAdded() + " on queue " + queue.getName());
Thread.sleep(10);
}
}
@@ -1307,10 +1314,9 @@
}
}
};
-
+
TCount tcount1 = null;
TCount tcount2 = null;
-
try
{
@@ -1337,8 +1343,7 @@
session.createQueue(PagingTest.ADDRESS.toString(), PagingTest.ADDRESS + "-2", null, true);
}
-
-
+
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
ClientMessage message = null;
@@ -1377,21 +1382,21 @@
PagingTest.PAGE_MAX,
new HashMap<String, AddressSettings>());
server.start();
-
+
Queue queue1 = server.locateQueue(PagingTest.ADDRESS.concat("-1"));
-
+
Queue queue2 = server.locateQueue(PagingTest.ADDRESS.concat("-2"));
-
+
assertNotNull(queue1);
-
+
assertNotNull(queue2);
-
+
assertNotSame(queue1, queue2);
tcount1 = new TCount(queue1);
-
+
tcount2 = new TCount(queue2);
-
+
tcount1.start();
tcount2.start();
@@ -1500,19 +1505,19 @@
finally
{
running.set(false);
-
+
if (tcount1 != null)
{
tcount1.interrupt();
tcount1.join();
}
-
+
if (tcount2 != null)
{
tcount2.interrupt();
tcount2.join();
}
-
+
try
{
server.stop();
@@ -2510,7 +2515,7 @@
producerThread.start();
- assertTrue(ready.await(10, TimeUnit.SECONDS));
+ assertTrue(ready.await(100, TimeUnit.SECONDS));
ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -609,7 +609,7 @@
{
}
- public SequentialFile copy()
+ public SequentialFile cloneFile()
{
return null; // To change body of implemented methods use File | Settings | File Templates.
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02 16:19:21 UTC (rev 11639)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02 16:57:20 UTC (rev 11640)
@@ -1174,7 +1174,9 @@
File fileTmp = new File(directory, files[j]);
if (!deleteDirectory(fileTmp))
{
+ // This is because of Windows is dumb on releasing files
log.warn("Couldn't delete " + fileTmp);
+ forceGC();
return false;
}
}
12 years, 7 months
JBoss hornetq SVN: r11639 - trunk/hornetq-core/src/main/java/org/hornetq/api/core/client.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:19:21 -0400 (Wed, 02 Nov 2011)
New Revision: 11639
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
Log:
add formating
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2011-11-02 16:19:01 UTC (rev 11638)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2011-11-02 16:19:21 UTC (rev 11639)
@@ -26,7 +26,7 @@
*/
public interface ServerLocator
{
-
+
/**
* Returns true if close was already called
* @return
@@ -37,19 +37,19 @@
* This method will disable any checks when a GarbageCollection happens
* leaving connections open. The JMS Layer will make specific usage of this
* method, since the ConnectionFactory.finalize should release this.
- *
+ *
* Warning: You may leave resources unattended if you call this method and
* don't take care of cleaning the resources yourself.
*/
void disableFinalizeCheck();
-
+
/**
* Create a ClientSessionFactory using whatever load balancing policy is in force
* @return The ClientSessionFactory
* @throws Exception
*/
ClientSessionFactory createSessionFactory() throws Exception;
-
+
/**
* Create a ClientSessionFactory to a specific server. The server must already be known about by this ServerLocator.
* This method allows the user to make a connection to a specific server bypassing any load balancing policy in force
@@ -58,39 +58,40 @@
* @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
*/
ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration) throws Exception;
-
+
/**
* Returns the period used to check if a client has failed to receive pings from the server.
- *
+ *
* Period is in milliseconds, default value is {@link HornetQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}.
- *
+ *
* @return the period used to check if a client has failed to receive pings from the server
*/
long getClientFailureCheckPeriod();
/**
* Sets the period (in milliseconds) used to check if a client has failed to receive pings from the server.
- *
+ *
* Value must be -1 (to disable) or greater than 0.
- *
+ *
* @param clientFailureCheckPeriod the period to check failure
*/
void setClientFailureCheckPeriod(long clientFailureCheckPeriod);
/**
- * When <code>true</code>, consumers created through this factory will create temporary files to cache large messages.
- *
+ * When <code>true</code>, consumers created through this factory will create temporary files to
+ * cache large messages.
+ * <p>
* There is 1 temporary file created for each large message.
- *
+ * <p>
* Default value is {@link HornetQClient#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}.
- *
- * @return <code>true</code> if consumers created through this factory will cache large messages in temporary files, <code>false</code> else
+ * @return <code>true</code> if consumers created through this factory will cache large messages
+ * in temporary files, <code>false</code> else
*/
boolean isCacheLargeMessagesClient();
/**
* Sets whether large messages received by consumers created through this factory will be cached in temporary files or not.
- *
+ *
* @param cached <code>true</code> to cache large messages in temporary files, <code>false</code> else
*/
void setCacheLargeMessagesClient(boolean cached);
@@ -98,112 +99,108 @@
/**
* Returns the connection <em>time-to-live</em>.
* This TTL determines how long the server will keep a connection alive in the absence of any data arriving from the client.
- *
+ *
* Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_CONNECTION_TTL}.
- *
+ *
* @return the connection time-to-live in milliseconds
*/
long getConnectionTTL();
/**
* Sets this factory's connections <em>time-to-live</em>.
- *
+ *
* Value must be -1 (to disable) or greater or equals to 0.
- *
+ *
* @param connectionTTL period in milliseconds
*/
void setConnectionTTL(long connectionTTL);
/**
* Returns the blocking calls timeout.
- *
- * If client's blocking calls to the server take more than this timeout, the call will throw a {@link HornetQException} with the code {@link HornetQException#CONNECTION_TIMEDOUT}.
- * Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_CALL_TIMEOUT}.
- *
+ * <p>
+ * If client's blocking calls to the server take more than this timeout, the call will throw a
+ * {@link HornetQException} with the code {@link HornetQException#CONNECTION_TIMEDOUT}. Value is
+ * in milliseconds, default value is {@link HornetQClient#DEFAULT_CALL_TIMEOUT}.
* @return the blocking calls timeout
*/
long getCallTimeout();
/**
* Sets the blocking call timeout.
- *
+ * <p>
* Value must be greater or equals to 0
- *
* @param callTimeout blocking call timeout in milliseconds
*/
void setCallTimeout(long callTimeout);
/**
* Returns the large message size threshold.
- *
+ * <p>
* Messages whose size is if greater than this value will be handled as <em>large messages</em>.
- *
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}.
- *
* @return the message size threshold to treat messages as large messages.
*/
int getMinLargeMessageSize();
/**
* Sets the large message size threshold.
- *
+ *
* Value must be greater than 0.
- *
+ *
* @param minLargeMessageSize large message size threshold in bytes
*/
void setMinLargeMessageSize(int minLargeMessageSize);
/**
* Returns the window size for flow control of the consumers created through this factory.
- *
+ * <p>
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_CONSUMER_WINDOW_SIZE}.
- *
* @return the window size used for consumer flow control
*/
int getConsumerWindowSize();
/**
* Sets the window size for flow control of the consumers created through this factory.
- *
- * Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 (to set the maximum size of the buffer)
- *
+ * <p>
+ * Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0
+ * (to set the maximum size of the buffer)
* @param consumerWindowSize window size (in bytes) used for consumer flow control
*/
void setConsumerWindowSize(int consumerWindowSize);
/**
* Returns the maximum rate of message consumption for consumers created through this factory.
- *
+ *
* This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified.
- *
+ *
* Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
* Default value is {@link HornetQClient#DEFAULT_CONSUMER_MAX_RATE}.
- *
+ *
* @return the consumer max rate
*/
int getConsumerMaxRate();
/**
* Sets the maximum rate of message consumption for consumers created through this factory.
- *
+ *
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
- *
+ *
* @param consumerMaxRate maximum rate of message consumption (in messages per seconds)
*/
void setConsumerMaxRate(int consumerMaxRate);
/**
* Returns the size for the confirmation window of clients using this factory.
- *
+ *
* Value is in bytes or -1 (to disable the window). Default value is {@link HornetQClient#DEFAULT_CONFIRMATION_WINDOW_SIZE}.
- *
+ *
* @return the size for the confirmation window of clients using this factory
*/
int getConfirmationWindowSize();
/**
* Sets the size for the confirmation window buffer of clients using this factory.
- *
+ *
* Value must be -1 (to disable the window) or greater than 0.
* @param confirmationWindowSize size of the confirmation window (in bytes)
@@ -212,40 +209,40 @@
/**
* Returns the window size for flow control of the producers created through this factory.
- *
+ *
* Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection).
* Default value is {@link HornetQClient#DEFAULT_PRODUCER_WINDOW_SIZE}.
- *
+ *
* @return the window size for flow control of the producers created through this factory.
*/
int getProducerWindowSize();
/**
* Returns the window size for flow control of the producers created through this factory.
- *
+ *
* Value must be -1 (to disable flow control) or greater than 0.
- *
+ *
* @param producerWindowSize window size (in bytest) for flow control of the producers created through this factory.
*/
void setProducerWindowSize(int producerWindowSize);
/**
* Returns the maximum rate of message production for producers created through this factory.
- *
+ *
* This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified.
- *
+ *
* Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
* Default value is {@link HornetQClient#DEFAULT_PRODUCER_MAX_RATE}.
- *
+ *
* @return maximum rate of message production (in messages per seconds)
*/
int getProducerMaxRate();
/**
* Sets the maximum rate of message production for producers created through this factory.
- *
+ *
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
- *
+ *
* @param producerMaxRate maximum rate of message production (in messages per seconds)
*/
void setProducerMaxRate(int producerMaxRate);
@@ -253,9 +250,9 @@
/**
* Returns whether consumers created through this factory will block while
* sending message acknowledgments or do it asynchronously.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}.
- *
+ *
* @return whether consumers will block while sending message
* acknowledgments or do it asynchronously
*/
@@ -264,7 +261,7 @@
/**
* Sets whether consumers created through this factory will block while
* sending message acknowledgments or do it asynchronously.
- *
+ *
* @param blockOnAcknowledge
* <code>true</code> to block when sending message
* acknowledgments or <code>false</code> to send them
@@ -277,7 +274,7 @@
* <br>
* If the session is configured to send durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
* to be notified once the message has been handled by the server.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_DURABLE_SEND}.
*
* @return whether producers will block while sending persistent messages or do it asynchronously
@@ -286,7 +283,7 @@
/**
* Sets whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
- *
+ *
* @param blockOnDurableSend <code>true</code> to block when sending durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnDurableSend(boolean blockOnDurableSend);
@@ -296,7 +293,7 @@
* <br>
* If the session is configured to send non-durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
* to be notified once the message has been handled by the server.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}.
*
* @return whether producers will block while sending non-durable messages or do it asynchronously
@@ -305,7 +302,7 @@
/**
* Sets whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
- *
+ *
* @param blockOnNonDurableSend <code>true</code> to block when sending non-durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnNonDurableSend(boolean blockOnNonDurableSend);
@@ -313,11 +310,11 @@
/**
* Returns whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
- *
+ *
* if <code>true</code>, a random unique group ID is created and set on each message for the property
* {@link org.hornetq.api.core.Message#HDR_GROUP_ID}.
* Default value is {@link HornetQClient#DEFAULT_AUTO_GROUP}.
- *
+ *
* @return whether producers will automatically assign a group ID to their messages
*/
boolean isAutoGroup();
@@ -325,23 +322,23 @@
/**
* Sets whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
- *
+ *
* @param autoGroup <code>true</code> to automatically assign a group ID to each messages sent through this factory, <code>false</code> else
*/
void setAutoGroup(boolean autoGroup);
/**
* Returns the group ID that will be eventually set on each message for the property {@link org.hornetq.api.core.Message#HDR_GROUP_ID}.
- *
+ *
* Default value is is <code>null</code> and no group ID will be set on the messages.
- *
+ *
* @return the group ID that will be eventually set on each message
*/
String getGroupID();
-
+
/**
* Sets the group ID that will be set on each message sent through this factory.
- *
+ *
* @param groupID the group ID to use
*/
void setGroupID(String groupID);
@@ -357,7 +354,7 @@
* Sets to <code>true</code> to pre-acknowledge consumed messages on the
* server before they are sent to consumers, else set to <code>false</code>
* to let clients acknowledge the message they consume.
- *
+ *
* @param preAcknowledge
* <code>true</code> to enable pre-acknowledgment,
* <code>false</code> else
@@ -366,18 +363,18 @@
/**
* Returns the acknowledgments batch size.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_ACK_BATCH_SIZE}.
- *
+ *
* @return the acknowledgments batch size
*/
int getAckBatchSize();
/**
* Sets the acknowledgments batch size.
- *
+ *
* Value must be equal or greater than 0.
- *
+ *
* @param ackBatchSize
* acknowledgments batch size
*/
@@ -398,9 +395,9 @@
/**
* Returns whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_USE_GLOBAL_POOLS}.
- *
+ *
* @return <code>true</code> if this factory uses global thread pools, <code>false</code> else
*/
boolean isUseGlobalPools();
@@ -408,117 +405,117 @@
/**
* Sets whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
- *
+ *
* @param useGlobalPools <code>true</code> to let this factory uses global thread pools, <code>false</code> else
*/
void setUseGlobalPools(boolean useGlobalPools);
/**
* Returns the maximum size of the scheduled thread pool.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
- *
+ *
* @return the maximum size of the scheduled thread pool.
*/
int getScheduledThreadPoolMaxSize();
/**
* Sets the maximum size of the scheduled thread pool.
- *
+ *
* This setting is relevant only if this factory does not use global pools.
* Value must be greater than 0.
- *
+ *
* @param scheduledThreadPoolMaxSize maximum size of the scheduled thread pool.
*/
void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
/**
* Returns the maximum size of the thread pool.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_THREAD_POOL_MAX_SIZE}.
- *
+ *
* @return the maximum size of the thread pool.
*/
int getThreadPoolMaxSize();
/**
* Sets the maximum size of the thread pool.
- *
+ *
* This setting is relevant only if this factory does not use global pools.
* Value must be -1 (for unlimited thread pool) or greater than 0.
- *
+ *
* @param threadPoolMaxSize maximum size of the thread pool.
*/
void setThreadPoolMaxSize(int threadPoolMaxSize);
/**
- * Returns the time to retry connections created by this factory after failure.
- *
+ * Returns the time to retry connections created by this factory after failure.
+ *
* Value is in milliseconds, default is {@link HornetQClient#DEFAULT_RETRY_INTERVAL}.
- *
+ *
* @return the time to retry connections created by this factory after failure
*/
long getRetryInterval();
/**
* Sets the time to retry connections created by this factory after failure.
- *
+ *
* Value must be greater than 0.
- *
- * @param retryInterval time (in milliseconds) to retry connections created by this factory after failure
+ *
+ * @param retryInterval time (in milliseconds) to retry connections created by this factory after failure
*/
void setRetryInterval(long retryInterval);
/**
* Returns the multiplier to apply to successive retry intervals.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
- *
+ *
* @return the multiplier to apply to successive retry intervals
*/
double getRetryIntervalMultiplier();
/**
* Sets the multiplier to apply to successive retry intervals.
- *
+ *
* Value must be positive.
- *
+ *
* @param retryIntervalMultiplier multiplier to apply to successive retry intervals
*/
void setRetryIntervalMultiplier(double retryIntervalMultiplier);
/**
* Returns the maximum retry interval (in the case a retry interval multiplier has been specified).
- *
+ *
* Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_MAX_RETRY_INTERVAL}.
- *
+ *
* @return the maximum retry interval
*/
long getMaxRetryInterval();
/**
* Sets the maximum retry interval.
- *
+ * <p>
* Value must be greater than 0.
- *
- * @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier has been specified
+ * @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier
+ * has been specified
*/
void setMaxRetryInterval(long maxRetryInterval);
/**
* Returns the maximum number of attempts to retry connection in case of failure.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_RECONNECT_ATTEMPTS}.
- *
+ *
* @return the maximum number of attempts to retry connection in case of failure.
*/
int getReconnectAttempts();
/**
* Sets the maximum number of attempts to retry connection in case of failure.
- *
+ *
* Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
- *
+ *
* @param reconnectAttempts maximum number of attempts to retry connection in case of failure
*/
void setReconnectAttempts(int reconnectAttempts);
@@ -529,66 +526,66 @@
/**
* Returns true if the client will automatically attempt to connect to the backup server if the initial
* connection to the live server fails
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}.
*/
boolean isFailoverOnInitialConnection();
-
+
/**
* Sets the value for FailoverOnInitialReconnection
- *
+ *
* @param failover
*/
void setFailoverOnInitialConnection(boolean failover);
/**
* Returns the class name of the connection load balancing policy.
- *
+ *
* Default value is "org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy".
- *
+ *
* @return the class name of the connection load balancing policy
*/
String getConnectionLoadBalancingPolicyClassName();
/**
* Sets the class name of the connection load balancing policy.
- *
+ *
* Value must be the name of a class implementing {@link ConnectionLoadBalancingPolicy}.
- *
+ *
* @param loadBalancingPolicyClassName class name of the connection load balancing policy
*/
void setConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName);
/**
* Returns the initial size of messages created through this factory.
- *
+ *
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
- *
+ *
* @return the initial size of messages created through this factory
*/
int getInitialMessagePacketSize();
/**
* Sets the initial size of messages created through this factory.
- *
+ *
* Value must be greater than 0.
- *
+ *
* @param size initial size of messages created through this factory.
*/
void setInitialMessagePacketSize(int size);
-
+
/**
* Adds an interceptor which will be executed <em>after packets are received from the server</em>.
- *
+ *
* @param interceptor an Interceptor
*/
void addInterceptor(Interceptor interceptor);
/**
* Removes an interceptor.
- *
+ *
* @param interceptor interceptor to remove
- *
+ *
* @return <code>true</code> if the interceptor is removed from this factory, <code>false</code> else
*/
boolean removeInterceptor(Interceptor interceptor);
@@ -599,9 +596,9 @@
void close();
boolean isHA();
-
+
boolean isCompressLargeMessage();
-
+
void setCompressLargeMessage(boolean compress);
void addClusterTopologyListener(ClusterTopologyListener listener);
12 years, 7 months
JBoss hornetq SVN: r11638 - in trunk: hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty and 5 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:19:01 -0400 (Wed, 02 Nov 2011)
New Revision: 11638
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java
trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyConnection.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
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
Log:
clean up
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-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -1056,11 +1056,8 @@
if (pingerFuture != null)
{
pingRunnable.cancel();
-
pingerFuture.cancel(false);
-
pingRunnable = null;
-
pingerFuture = null;
}
}
@@ -1520,7 +1517,7 @@
{
private final CoreRemotingConnection conn;
- public CloseRunnable(CoreRemotingConnection conn)
+ private CloseRunnable(CoreRemotingConnection conn)
{
this.conn = conn;
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java 2011-11-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -88,8 +88,8 @@
{
static final Logger log = Logger.getLogger(NettyAcceptor.class);
- private ClusterConnection clusterConnection;
-
+ private final ClusterConnection clusterConnection;
+
private ChannelFactory channelFactory;
private volatile ChannelGroup serverChannelGroup;
@@ -139,11 +139,11 @@
private final int nioRemotingThreads;
private final HttpKeepAliveRunnable httpKeepAliveRunnable;
-
+
private HttpAcceptorHandler httpHandler = null;
private final ConcurrentMap<Object, NettyConnection> connections = new ConcurrentHashMap<Object, NettyConnection>();
-
+
private final Map<String, Object> configuration;
private final Executor threadPool;
@@ -163,8 +163,8 @@
private final long batchDelay;
private final boolean directDeliver;
-
+
public NettyAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
final BufferDecoder decoder,
@@ -184,11 +184,11 @@
final Executor threadPool,
final ScheduledExecutorService scheduledThreadPool)
{
-
+
this.clusterConnection = clusterConnection;
-
+
this.configuration = configuration;
-
+
this.handler = handler;
this.decoder = decoder;
@@ -372,7 +372,7 @@
if (httpEnabled)
{
handlers.put("http-decoder", new HttpRequestDecoder());
-
+
handlers.put("http-aggregator", new HttpChunkAggregator(Integer.MAX_VALUE));
handlers.put("http-encoder", new HttpResponseEncoder());
@@ -509,7 +509,7 @@
serverChannelGroup.add(serverChannel);
}
}
-
+
public Map<String, Object> getConfiguration()
{
return this.configuration;
@@ -586,7 +586,7 @@
e.printStackTrace();
}
}
-
+
if (httpHandler != null)
{
httpHandler.shutdown();
@@ -646,7 +646,7 @@
{
this.notificationService = notificationService;
}
-
+
/* (non-Javadoc)
* @see org.hornetq.spi.core.remoting.Acceptor#getClusterConnection()
*/
@@ -733,12 +733,12 @@
public void connectionReadyForWrites(final Object connectionID, boolean ready)
{
NettyConnection conn = connections.get(connectionID);
-
+
if (conn != null)
{
conn.fireReady(ready);
- }
- }
+ }
+ }
}
private class BatchFlusher implements Runnable
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyConnection.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyConnection.java 2011-11-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/remoting/impl/netty/NettyConnection.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -270,7 +270,7 @@
readyListeners.remove(listener);
}
- public void fireReady(final boolean ready)
+ void fireReady(final boolean ready)
{
for (ReadyListener listener: readyListeners)
{
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-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -161,7 +161,7 @@
ScheduledExecutorService getScheduledPool();
ExecutorService getThreadPool();
-
+
ExecutorFactory getExecutorFactory();
void setGroupingHandler(GroupingHandler groupingHandler);
@@ -172,8 +172,6 @@
ReplicationManager getReplicationManager();
- boolean checkActivate() throws Exception;
-
void deployDivert(DivertConfiguration config) throws Exception;
void destroyDivert(SimpleString name) throws Exception;
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-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -1057,36 +1057,6 @@
return connectorsService;
}
- public synchronized boolean checkActivate() throws Exception
- {
- if (configuration.isBackup())
- {
- // Handle backup server activation
-
- if (!configuration.isSharedStore())
- {
- if (replicationEndpoint == null)
- {
- HornetQServerImpl.log.warn("There is no replication endpoint, can't activate this backup server");
-
- throw new HornetQException(HornetQException.INTERNAL_ERROR, "Can't activate the server");
- }
-
- replicationEndpoint.stop();
- }
-
- // Complete the startup procedure
-
- HornetQServerImpl.log.info("Activating backup server");
-
- configuration.setBackup(false);
-
- initialisePart2();
- }
-
- return true;
- }
-
public void deployDivert(DivertConfiguration config) throws Exception
{
if (config.getName() == null)
Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
--- trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-11-02 16:18:22 UTC (rev 11637)
+++ trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -759,7 +759,7 @@
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
- class InVMNodeManagerServer extends HornetQServerImpl
+ public final class InVMNodeManagerServer extends HornetQServerImpl
{
final NodeManager nodeManager;
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java 2011-11-02 16:18:22 UTC (rev 11637)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -13,7 +13,6 @@
package org.hornetq.tests.integration.cluster.failover;
-import org.hornetq.core.config.Configuration;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
@@ -21,8 +20,6 @@
* A NettyReplicatedFailoverTest
*
* @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class NettyReplicatedFailoverTest extends NettyFailoverTest
{
@@ -46,17 +43,17 @@
{
return new SameProcessHornetQServer(createServer(true, liveConfig));
}
-
+
@Override
protected TestableServer createBackupServer()
{
return new SameProcessHornetQServer(createServer(true, backupConfig));
}
-
+
@Override
protected void createConfigs() throws Exception
{
- createReplicatedConfigs();
+ createReplicatedConfigs();
}
// Private -------------------------------------------------------
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2011-11-02 16:18:22 UTC (rev 11637)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2011-11-02 16:19:01 UTC (rev 11638)
@@ -28,7 +28,6 @@
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
-import javax.management.MBeanServer;
import junit.framework.Assert;
@@ -40,13 +39,11 @@
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.config.ClusterConnectionConfiguration;
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.InVMRegistry;
import org.hornetq.core.remoting.impl.invm.TransportConstants;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.HornetQServerImpl;
import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQDestination;
@@ -54,21 +51,20 @@
import org.hornetq.jms.server.JMSServerManager;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.tests.integration.jms.server.management.JMSUtil;
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.ServiceTestBase;
/**
- *
+ *
* A JMSFailoverTest
*
* A simple test to test failover when using the JMS API.
* Most of the failover tests are done on the Core API.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
+ *
* Created 7 Nov 2008 11:13:39
*
*
@@ -256,15 +252,17 @@
public void testManualFailover() throws Exception
{
- HornetQConnectionFactory jbcfLive = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
- new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+ HornetQConnectionFactory jbcfLive =
+ HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration(INVM_CONNECTOR_FACTORY));
jbcfLive.setBlockOnNonDurableSend(true);
jbcfLive.setBlockOnDurableSend(true);
- HornetQConnectionFactory jbcfBackup = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
- new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory",
- backupParams));
+ HornetQConnectionFactory jbcfBackup =
+ HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration(INVM_CONNECTOR_FACTORY,
+ backupParams));
jbcfBackup.setBlockOnNonDurableSend(true);
jbcfBackup.setBlockOnDurableSend(true);
jbcfBackup.setInitialConnectAttempts(-1);
@@ -348,13 +346,12 @@
protected void startServers() throws Exception
{
NodeManager nodeManager = new InVMNodeManager();
- backuptc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory", backupParams);
- livetc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
+ backuptc = new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams);
+ livetc = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
- liveAcceptortc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory");
+ liveAcceptortc = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
- backupAcceptortc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory",
- backupParams);
+ backupAcceptortc = new TransportConfiguration(INVM_ACCEPTOR_FACTORY, backupParams);
backupConf = createBasicConfig(0);
@@ -378,8 +375,7 @@
backupConf.setSecurityEnabled(false);
backupConf.setJournalType(getDefaultJournalType());
backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
- backupConf.getAcceptorConfigurations()
- .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory", backupParams));
+ backupConf.getAcceptorConfigurations().add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, backupParams));
backupConf.setBackup(true);
backupConf.setSharedStore(true);
backupConf.setBindingsDirectory(getBindingsDir());
@@ -389,7 +385,7 @@
backupConf.setLargeMessagesDirectory(getLargeMessagesDir());
backupConf.setPersistenceEnabled(true);
backupConf.setClustered(true);
- backupService = new InVMNodeManagerServer(backupConf, nodeManager);
+ backupService = new ServiceTestBase.InVMNodeManagerServer(backupConf, nodeManager);
backupJMSService = new JMSServerManagerImpl(backupService);
@@ -481,53 +477,4 @@
this.e = e;
}
}
-
- // Inner classes -------------------------------------------------
- class InVMNodeManagerServer extends HornetQServerImpl
- {
- final NodeManager nodeManager;
-
- public InVMNodeManagerServer(NodeManager nodeManager)
- {
- super();
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration, NodeManager nodeManager)
- {
- super(configuration);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration, MBeanServer mbeanServer, NodeManager nodeManager)
- {
- super(configuration, mbeanServer);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration,
- HornetQSecurityManager securityManager,
- NodeManager nodeManager)
- {
- super(configuration, securityManager);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration,
- MBeanServer mbeanServer,
- HornetQSecurityManager securityManager,
- NodeManager nodeManager)
- {
- super(configuration, mbeanServer, securityManager);
- this.nodeManager = nodeManager;
- }
-
- @Override
- protected NodeManager createNodeManager(String directory)
- {
- return nodeManager;
- }
-
- }
-
}
12 years, 7 months
JBoss hornetq SVN: r11637 - in trunk: hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal and 8 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:18:22 -0400 (Wed, 02 Nov 2011)
New Revision: 11637
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java
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/nullpm/NullStorageManager.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/PacketDecoder.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/ReplicationStartSyncMessage.java
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/ReplicationManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/NodeManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/QuorumManager.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
Log:
HORNETQ-720 Send live's nodeID to the backup at the end of synchronization.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -22,6 +22,7 @@
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.journal.Journal;
import org.hornetq.core.journal.JournalLoadInformation;
@@ -42,6 +43,7 @@
import org.hornetq.core.server.RouteContextList;
import org.hornetq.core.server.RoutingContext;
import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.group.impl.GroupBinding;
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.transaction.Transaction;
@@ -70,9 +72,9 @@
/** Set the context back to the thread */
void setContext(OperationContext context);
-
+
/**
- *
+ *
* @param ioCriticalError is the server being stopped due to an IO critical error
*/
void stop(boolean ioCriticalError) throws Exception;
@@ -109,7 +111,7 @@
/** Confirms that a large message was finished */
void confirmPendingLargeMessageTX(Transaction transaction, long messageID, long recordID) throws Exception;
-
+
/** Confirms that a large message was finished */
void confirmPendingLargeMessage(long recordID) throws Exception;
@@ -157,7 +159,7 @@
* @param message This is a temporary message that holds the parsed properties.
* The remoting layer can't create a ServerMessage directly, then this will be replaced.
* @return
- * @throws Exception
+ * @throws Exception
*/
LargeServerMessage createLargeMessage(long id, MessageInternal message) throws Exception;
@@ -249,9 +251,14 @@
/**
* @param replicationManager
* @param pagingManager
+ * @param nodeID
+ * @param clusterConnection
+ * @param pair
* @throws Exception
*/
- void startReplication(ReplicationManager replicationManager, PagingManager pagingManager) throws Exception;
+ void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID,
+ ClusterConnection clusterConnection, Pair<TransportConfiguration, TransportConfiguration> pair)
+ throws Exception;
/**
* Adds message to page if we are paging.
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-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -42,6 +42,7 @@
import org.hornetq.api.core.Message;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.filter.Filter;
@@ -90,6 +91,7 @@
import org.hornetq.core.server.RouteContextList;
import org.hornetq.core.server.RoutingContext;
import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.group.impl.GroupBinding;
import org.hornetq.core.server.impl.ServerMessageImpl;
import org.hornetq.core.transaction.ResourceManager;
@@ -219,9 +221,11 @@
private boolean journalLoaded = false;
// Persisted core configuration
- private final Map<SimpleString, PersistedRoles> mapPersistedRoles = new ConcurrentHashMap<SimpleString, PersistedRoles>();
+ private final Map<SimpleString, PersistedRoles> mapPersistedRoles =
+ new ConcurrentHashMap<SimpleString, PersistedRoles>();
- private final Map<SimpleString, PersistedAddressSetting> mapPersistedAddressSettings = new ConcurrentHashMap<SimpleString, PersistedAddressSetting>();
+ private final Map<SimpleString, PersistedAddressSetting> mapPersistedAddressSettings =
+ new ConcurrentHashMap<SimpleString, PersistedAddressSetting>();
public JournalStorageManager(final Configuration config, final ExecutorFactory executorFactory,
final IOCriticalErrorListener criticalErrorListener)
@@ -231,24 +235,24 @@
public JournalStorageManager(final Configuration config, final ExecutorFactory executorFactory,
final ReplicationManager replicator, final IOCriticalErrorListener criticalErrorListener)
- {
- this.executorFactory = executorFactory;
+ {
+ this.executorFactory = executorFactory;
- executor = executorFactory.getExecutor();
+ executor = executorFactory.getExecutor();
- this.replicator = replicator;
+ this.replicator = replicator;
- if (config.getJournalType() != JournalType.NIO && config.getJournalType() != JournalType.ASYNCIO)
- {
- throw new IllegalArgumentException("Only NIO and AsyncIO are supported journals");
- }
+ if (config.getJournalType() != JournalType.NIO && config.getJournalType() != JournalType.ASYNCIO)
+ {
+ throw new IllegalArgumentException("Only NIO and AsyncIO are supported journals");
+ }
- bindingsDir = config.getBindingsDirectory();
+ bindingsDir = config.getBindingsDirectory();
- if (bindingsDir == null)
- {
- throw new NullPointerException("bindings-dir is null");
- }
+ if (bindingsDir == null)
+ {
+ throw new NullPointerException("bindings-dir is null");
+ }
createBindingsDir = config.isCreateBindingsDir();
@@ -306,11 +310,11 @@
config.getJournalBufferTimeout_NIO(),
config.isLogJournalWriteRate(),
criticalErrorListener);
- }
- else
- {
- throw new IllegalArgumentException("Unsupported journal type " + config.getJournalType());
- }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported journal type " + config.getJournalType());
+ }
idGenerator = new BatchingIDGenerator(0, JournalStorageManager.CHECKPOINT_BATCH_SIZE, bindingsJournal);
Journal localMessage = new JournalImpl(config.getJournalFileSize(),
@@ -323,22 +327,20 @@
config.getJournalType() == JournalType.ASYNCIO ? config.getJournalMaxIO_AIO()
: config.getJournalMaxIO_NIO());
- if (replicator != null)
- {
- messageJournal = new ReplicatedJournal((byte)1, localMessage, replicator);
- }
- else
- {
- messageJournal = localMessage;
- }
+ if (replicator != null)
+ {
+ messageJournal = new ReplicatedJournal((byte)1, localMessage, replicator);
+ }
+ else
+ {
+ messageJournal = localMessage;
+ }
- largeMessagesDirectory = config.getLargeMessagesDirectory();
+ largeMessagesDirectory = config.getLargeMessagesDirectory();
+ largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDirectory, false, criticalErrorListener);
+ perfBlastPages = config.getJournalPerfBlastPages();
+ }
- largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDirectory, false, criticalErrorListener);
-
- perfBlastPages = config.getJournalPerfBlastPages();
- }
-
public void clearContext()
{
OperationContextImpl.clearContext();
@@ -355,7 +357,9 @@
* @throws HornetQException
*/
@Override
- public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager) throws Exception
+ public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID,
+ ClusterConnection clusterConnection, Pair<TransportConfiguration, TransportConfiguration> pair)
+ throws Exception
{
if (!started)
{
@@ -418,7 +422,8 @@
storageManagerLock.writeLock().lock();
try
{
- replicator.sendSynchronizationDone();
+ replicator.sendSynchronizationDone(nodeID);
+ clusterConnection.nodeAnnounced(System.currentTimeMillis(), nodeID, pair, true);
// XXX HORNETQ-720 SEND a compare journals message?
}
finally
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -24,6 +24,7 @@
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.journal.Journal;
import org.hornetq.core.journal.JournalLoadInformation;
@@ -47,6 +48,7 @@
import org.hornetq.core.server.RouteContextList;
import org.hornetq.core.server.RoutingContext;
import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.group.impl.GroupBinding;
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.transaction.Transaction;
@@ -580,16 +582,10 @@
{
}
- /* (non-Javadoc)
- * @see org.hornetq.core.persistence.StorageManager#confirmPendingLargeMessage(long)
- */
public void confirmPendingLargeMessage(long recordID) throws Exception
{
}
- /* (non-Javadoc)
- * @see org.hornetq.core.persistence.StorageManager#stop(boolean)
- */
public void stop(boolean ioCriticalError) throws Exception
{
}
@@ -607,7 +603,8 @@
}
@Override
- public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager) throws Exception
+ public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID,
+ ClusterConnection clusterConnection, Pair<TransportConfiguration, TransportConfiguration> pair) throws Exception
{
// no-op
}
@@ -621,5 +618,4 @@
{
return false;
}
-
}
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-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -208,14 +208,9 @@
} else if (packet.getType() == PacketImpl.BACKUP_REGISTRATION)
{
BackupRegistrationMessage msg = (BackupRegistrationMessage)packet;
- if (server.startReplication(rc))
+ if (server.startReplication(rc, acceptorUsed.getClusterConnection(), getPair(msg.getConnector(), true)))
{
- /*
- * HORNETQ-720 Instantiate a new server locator to call notifyNodeUp(...)? Or send
- * a CLUSTER_TOPOLOGY(_2?) message?
- */
- acceptorUsed.getClusterConnection().nodeAnnounced(System.currentTimeMillis(), msg.getNodeID(),
- getPair(msg.getConnector(), true), true);
+ // XXX if it fails, the backup should get to know it
}
}
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -547,7 +547,7 @@
packet = new BackupRegistrationMessage();
break;
}
- case PacketImpl.REPLICATION_START_STOP_SYNC:
+ case PacketImpl.REPLICATION_START_FINISH_SYNC:
{
packet = new ReplicationStartSyncMessage();
break;
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-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketImpl.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -204,7 +204,7 @@
public static final byte BACKUP_REGISTRATION = 115;
- public static final byte REPLICATION_START_STOP_SYNC = 120;
+ public static final byte REPLICATION_START_FINISH_SYNC = 120;
// Static --------------------------------------------------------
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -16,20 +16,24 @@
private long[] ids;
private JournalContent journalType;
private boolean synchronizationIsFinished;
+ private String nodeID;
public ReplicationStartSyncMessage()
{
- super(REPLICATION_START_STOP_SYNC);
+ super(REPLICATION_START_FINISH_SYNC);
}
+ public ReplicationStartSyncMessage(String nodeID)
+ {
+ this();
+ synchronizationIsFinished = true;
+ this.nodeID = nodeID;
+ }
+
public ReplicationStartSyncMessage(JournalFile[] datafiles, JournalContent contentType)
{
this();
- if (datafiles == null && contentType == null)
- {
- synchronizationIsFinished = true;
- return;
- }
+ synchronizationIsFinished = false;
ids = new long[datafiles.length];
for (int i = 0; i < datafiles.length; i++)
{
@@ -43,7 +47,10 @@
{
buffer.writeBoolean(synchronizationIsFinished);
if (synchronizationIsFinished)
+ {
+ buffer.writeString(nodeID);
return;
+ }
buffer.writeByte(journalType.typeByte);
buffer.writeInt(ids.length);
for (long id : ids)
@@ -57,7 +64,10 @@
{
synchronizationIsFinished = buffer.readBoolean();
if (synchronizationIsFinished)
+ {
+ nodeID = buffer.readString();
return;
+ }
journalType = JournalContent.getType(buffer.readByte());
int length = buffer.readInt();
ids = new long[length];
@@ -85,4 +95,9 @@
{
return ids;
}
+
+ public String getNodeID()
+ {
+ return nodeID;
+ }
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/replication/ReplicationManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/replication/ReplicationManager.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/replication/ReplicationManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -98,9 +98,11 @@
/**
* Informs backup that data synchronization is done.
* <p>
- * So if 'live' fails, the (up-to-date) backup now may take over its duties.
+ * So if 'live' fails, the (up-to-date) backup now may take over its duties. To do so, it must
+ * know which is the live's {@code nodeID}.
+ * @param nodeID
*/
- void sendSynchronizationDone();
+ void sendSynchronizationDone(String nodeID);
/**
* Sends the whole content of the file to be duplicated.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -88,11 +88,6 @@
private final IOCriticalErrorListener criticalErrorListener;
- private static void trace(final String msg)
- {
- ReplicationEndpointImpl.log.trace(msg);
- }
-
private final HornetQServerImpl server;
private Channel channel;
@@ -152,10 +147,6 @@
journals[id] = journal;
}
- /*
- * (non-Javadoc)
- * @see org.hornetq.core.remoting.ChannelHandler#handlePacket(org.hornetq.core.remoting.Packet)
- */
public void handlePacket(final Packet packet)
{
PacketImpl response = new ReplicationResponseMessage();
@@ -212,7 +203,7 @@
handleCompareDataMessage((ReplicationCompareDataMessage)packet);
response = new NullResponseMessage();
}
- else if (type == PacketImpl.REPLICATION_START_STOP_SYNC)
+ else if (type == PacketImpl.REPLICATION_START_FINISH_SYNC)
{
handleStartReplicationSynchronization((ReplicationStartSyncMessage)packet);
}
@@ -425,7 +416,7 @@
// Private -------------------------------------------------------
- private void finishSynchronization() throws Exception
+ private void finishSynchronization(String nodeID) throws Exception
{
for (JournalContent jc : EnumSet.allOf(JournalContent.class))
{
@@ -486,7 +477,7 @@
}
}
journalsHolder = null;
- server.setRemoteBackupUpToDate();
+ server.setRemoteBackupUpToDate(nodeID);
log.info("Backup server " + server + " is synchronized with live-server.");
return;
}
@@ -565,7 +556,7 @@
if (packet.isSynchronizationFinished())
{
- finishSynchronization();
+ finishSynchronization(packet.getNodeID());
return;
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -480,7 +480,6 @@
private static class NullEncoding implements EncodingSupport
{
-
static NullEncoding instance = new NullEncoding();
public void decode(final HornetQBuffer buffer)
@@ -495,7 +494,6 @@
{
return 0;
}
-
}
@Override
@@ -528,8 +526,8 @@
@Override
public void syncPages(SequentialFile file, long id, SimpleString queueName) throws Exception
{
- if (enabled)
- sendLargeFile(null, queueName, id, file, Long.MAX_VALUE);
+ if (enabled)
+ sendLargeFile(null, queueName, id, file, Long.MAX_VALUE);
}
/**
@@ -541,10 +539,7 @@
* @param maxBytesToSend maximum number of bytes to read and send from the file
* @throws Exception
*/
- private void sendLargeFile(JournalContent content,
- SimpleString pageStore,
- final long id,
- SequentialFile file,
+ private void sendLargeFile(JournalContent content, SimpleString pageStore, final long id, SequentialFile file,
long maxBytesToSend) throws Exception
{
if (!enabled)
@@ -564,23 +559,23 @@
int toSend = bytesRead;
if (bytesRead > 0)
{
- if (bytesRead >= maxBytesToSend)
- {
- toSend = (int)maxBytesToSend;
- maxBytesToSend = 0;
+ if (bytesRead >= maxBytesToSend)
+ {
+ toSend = (int)maxBytesToSend;
+ maxBytesToSend = 0;
+ }
+ else
+ {
+ maxBytesToSend = maxBytesToSend - bytesRead;
+ }
+ buffer.limit(toSend);
}
- else
- {
- maxBytesToSend = maxBytesToSend - bytesRead;
- }
- buffer.limit(toSend);
- }
- buffer.rewind();
+ buffer.rewind();
- // sending -1 or 0 bytes will close the file at the backup
- sendReplicatePacket(new ReplicationSyncFileMessage(content, pageStore, id, bytesRead, buffer));
- if (bytesRead == -1 || bytesRead == 0 || maxBytesToSend == 0)
- break;
+ // sending -1 or 0 bytes will close the file at the backup
+ sendReplicatePacket(new ReplicationSyncFileMessage(content, pageStore, id, bytesRead, buffer));
+ if (bytesRead == -1 || bytesRead == 0 || maxBytesToSend == 0)
+ break;
}
}
finally
@@ -597,9 +592,9 @@
}
@Override
- public void sendSynchronizationDone()
+ public void sendSynchronizationDone(String nodeID)
{
if (enabled)
- sendReplicatePacket(new ReplicationStartSyncMessage(null, null));
+ sendReplicatePacket(new ReplicationStartSyncMessage(nodeID));
}
}
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-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/HornetQServer.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -20,7 +20,9 @@
import javax.management.MBeanServer;
+import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.BridgeConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.DivertConfiguration;
@@ -33,6 +35,7 @@
import org.hornetq.core.replication.ReplicationEndpoint;
import org.hornetq.core.replication.ReplicationManager;
import org.hornetq.core.security.Role;
+import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.cluster.ClusterManager;
import org.hornetq.core.server.group.GroupingHandler;
import org.hornetq.core.server.impl.ConnectorsService;
@@ -57,7 +60,7 @@
public interface HornetQServer extends HornetQComponent
{
- /** This method was created mainly for testing but it may be used in scenarios where
+ /** This method was created mainly for testing but it may be used in scenarios where
* you need to have more than one Server inside the same VM.
* This identity will be exposed on logs what may help you to debug issues on the log traces and debugs.*/
void setIdentity(String identity);
@@ -65,7 +68,7 @@
String getIdentity();
String describe();
-
+
Configuration getConfiguration();
RemotingService getRemotingService();
@@ -113,7 +116,7 @@
Set<ServerSession> getSessions();
boolean isStarted();
-
+
boolean isStopped();
HierarchicalRepository<Set<Role>> getSecurityRepository();
@@ -182,14 +185,17 @@
void destroyBridge(String name) throws Exception;
ServerSession getSessionByID(String sessionID);
-
+
void threadDump(String reason);
void stop(boolean failoverOnServerShutdown) throws Exception;
/**
* @param rc
+ * @param pair
+ * @param clusterConnection
* @return {@code true} if replication started successfully, {@code false} otherwise
*/
- boolean startReplication(CoreRemotingConnection rc);
+ boolean startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
+ Pair<TransportConfiguration, TransportConfiguration> pair);
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/NodeManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/NodeManager.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/NodeManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -69,6 +69,11 @@
return uuid;
}
+ public void setNodeID(String nodeID)
+ {
+ this.nodeID = new SimpleString(nodeID);
+ }
+
public abstract boolean isAwaitingFailback() throws Exception;
public abstract boolean isBackupLive() throws Exception;
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-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -109,6 +109,7 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.QueueFactory;
import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.cluster.ClusterManager;
import org.hornetq.core.server.cluster.Transformer;
import org.hornetq.core.server.cluster.impl.ClusterManagerImpl;
@@ -473,7 +474,7 @@
stop(failoverOnServerShutdown, false);
}
- protected void stop(boolean failoverOnServerShutdown, boolean criticalIOError) throws Exception
+ private void stop(boolean failoverOnServerShutdown, boolean criticalIOError) throws Exception
{
synchronized (this)
{
@@ -584,7 +585,7 @@
for (Runnable task : tasks)
{
- HornetQServerImpl.log.debug(this + "::Waiting for " + task);
+ HornetQServerImpl.log.info(this + "::Waiting for " + task);
}
if (memoryManager != null)
@@ -592,9 +593,9 @@
memoryManager.stop();
}
- threadPool.shutdown();
+ threadPool.shutdown();
- scheduledPool.shutdown();
+ scheduledPool.shutdown();
try
{
@@ -1222,7 +1223,7 @@
// null);
// }
- protected PagingManager createPagingManager()
+ private PagingManager createPagingManager()
{
return new PagingManagerImpl(new PagingStoreFactoryNIO(configuration.getPagingDirectory(),
@@ -1238,7 +1239,7 @@
/**
* This method is protected as it may be used as a hook for creating a custom storage manager (on tests for instance)
*/
- protected StorageManager createStorageManager()
+ private StorageManager createStorageManager()
{
if (configuration.isPersistenceEnabled())
{
@@ -2086,7 +2087,7 @@
final TransportConfiguration config = configuration.getConnectorConfigurations().get(liveConnectorName);
serverLocator = (ServerLocatorInternal)HornetQClient.createServerLocatorWithHA(config);
- final QuorumManager quorumManager = new QuorumManager(serverLocator, nodeManager.getNodeId().toString());
+ final QuorumManager quorumManager = new QuorumManager(serverLocator);
serverLocator.setReconnectAttempts(-1);
@@ -2127,10 +2128,11 @@
while (true)
{
nodeManager.awaitLiveNode();
- if (!started || quorumManager.isNodeDown())
- {
- break;
- }
+ break;
+// if (!started || quorumManager.isNodeDown())
+// {
+// break;
+// }
}
serverLocator.close();
@@ -2278,13 +2280,20 @@
@Override
- public boolean startReplication(CoreRemotingConnection rc)
+ public boolean startReplication(CoreRemotingConnection rc, ClusterConnection clusterConnection,
+ Pair<TransportConfiguration, TransportConfiguration> pair)
{
+ if (replicationManager != null)
+ {
+ return false;
+ }
+
replicationManager = new ReplicationManagerImpl(rc, executorFactory);
try
{
replicationManager.start();
- storageManager.startReplication(replicationManager, pagingManager);
+ storageManager.startReplication(replicationManager, pagingManager, getNodeID().toString(), clusterConnection,
+ pair);
return true;
}
catch (Exception e)
@@ -2313,8 +2322,9 @@
return backupUpToDate;
}
- public void setRemoteBackupUpToDate()
+ public void setRemoteBackupUpToDate(String nodeID)
{
+ nodeManager.setNodeID(nodeID);
backupUpToDate = true;
}
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/QuorumManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/QuorumManager.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/QuorumManager.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -32,16 +32,14 @@
// volatile boolean started;
private final ServerLocator locator;
- private final String targetServerName;
+ private final String targetServerName = "";
private final Map<String, Pair<TransportConfiguration, TransportConfiguration>> nodes =
new ConcurrentHashMap<String, Pair<TransportConfiguration, TransportConfiguration>>();
private static final long DISCOVERY_TIMEOUT = 3;
- public QuorumManager(ServerLocator serverLocator, String nodeID)
+ public QuorumManager(ServerLocator serverLocator)
{
this.locator = serverLocator;
- this.targetServerName = nodeID;
-
locator.addClusterTopologyListener(this);
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-11-02 16:17:48 UTC (rev 11636)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-11-02 16:18:22 UTC (rev 11637)
@@ -140,7 +140,7 @@
deliver();
}
- if (packet.getType() == PacketImpl.REPLICATION_START_STOP_SYNC && mustHold)
+ if (packet.getType() == PacketImpl.REPLICATION_START_FINISH_SYNC && mustHold)
{
ReplicationStartSyncMessage syncMsg = (ReplicationStartSyncMessage)packet;
if (syncMsg.isSynchronizationFinished() && !deliver)
12 years, 7 months
JBoss hornetq SVN: r11636 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:17:48 -0400 (Wed, 02 Nov 2011)
New Revision: 11636
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
Log:
Delete dead-code which -if used- would trigger NPE.
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-02 16:17:34 UTC (rev 11635)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2011-11-02 16:17:48 UTC (rev 11636)
@@ -24,7 +24,6 @@
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.JournalType;
import org.hornetq.tests.integration.cluster.util.RemoteProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.RemoteServerConfiguration;
@@ -137,13 +136,14 @@
}
+ @Override
protected boolean isNetty()
{
return true;
}
@Override
- protected void createLiveConfig(int liveNode, int... otherLiveNodes)
+ protected void createLiveConfig(int liveNode)
{
servers.put(liveNode, new RemoteProcessHornetQServer(SharedLiveServerConfiguration.class.getName()));
}
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-02 16:17:34 UTC (rev 11635)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2011-11-02 16:17:48 UTC (rev 11636)
@@ -39,7 +39,7 @@
protected Map<Integer, TestableServer> servers = new HashMap<Integer, TestableServer>();
private NodeManager nodeManager;
-
+
Logger log = Logger.getLogger(SingleLiveMultipleBackupsFailoverTest.class);
public void _testLoop() throws Exception
@@ -61,7 +61,7 @@
createBackupConfig(0, 3, 0, 1, 2, 4, 5);
createBackupConfig(0, 4, 0, 1, 2, 3, 5);
createBackupConfig(0, 5, 0, 1, 2, 3, 4);
-
+
servers.get(0).start();
waitForServer(servers.get(0).getServer());
servers.get(1).start();
@@ -72,9 +72,9 @@
servers.get(5).start();
ServerLocatorImpl locator = (ServerLocatorImpl)getServerLocator(0);
-
+
Topology topology = locator.getTopology();
-
+
// for logging and debugging
topology.setOwner("testMultipleFailovers");
@@ -88,7 +88,7 @@
log.info("failing node 0");
servers.get(0).crash(session);
-
+
session.close();
backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5);
session = sendAndConsume(sf, false);
@@ -121,7 +121,7 @@
locator.close();
}
-
+
protected void createBackupConfig(int liveNode, int nodeid, int... nodes)
{
Configuration config1 = super.createDefaultConfig();
@@ -157,7 +157,7 @@
servers.put(nodeid, new SameProcessHornetQServer(createInVMFailoverServer(true, config1, nodeManager, nodeid)));
}
- protected void createLiveConfig(int liveNode, int... otherLiveNodes)
+ protected void createLiveConfig(int liveNode)
{
TransportConfiguration liveConnector =
createTransportConfiguration(isNetty(), false, generateParams(liveNode, isNetty()));
@@ -168,18 +168,9 @@
config0.setSecurityEnabled(false);
config0.setSharedStore(true);
config0.setClustered(true);
- List<String> pairs = null;
- for (int node : otherLiveNodes)
- {
- TransportConfiguration otherLiveConnector =
- createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
- config0.getConnectorConfigurations().put(otherLiveConnector.getName(), otherLiveConnector);
- pairs.add(otherLiveConnector.getName());
-
- }
ClusterConnectionConfiguration ccc0 =
new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs, false);
+ null, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
12 years, 7 months
JBoss hornetq SVN: r11635 - trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:17:34 -0400 (Wed, 02 Nov 2011)
New Revision: 11635
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
Log:
Reduce class' visibility
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-02 16:17:20 UTC (rev 11634)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-02 16:17:34 UTC (rev 11635)
@@ -52,7 +52,7 @@
*
* @author Tim Fox
*/
-public class CoreProtocolManager implements ProtocolManager
+class CoreProtocolManager implements ProtocolManager
{
private static final Logger log = Logger.getLogger(CoreProtocolManager.class);
@@ -62,7 +62,7 @@
private final List<Interceptor> interceptors;
- public CoreProtocolManager(final HornetQServer server, final List<Interceptor> interceptors)
+ CoreProtocolManager(final HornetQServer server, final List<Interceptor> interceptors)
{
this.server = server;
12 years, 7 months
JBoss hornetq SVN: r11634 - in trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest: queue/push/xml and 1 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-02 12:17:20 -0400 (Wed, 02 Nov 2011)
New Revision: 11634
Modified:
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnknownMediaType.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnmarshalException.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/Authentication.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/AuthenticationType.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/BasicAuth.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/DigestAuth.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/PushRegistration.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlHttpHeader.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlLink.java
trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/PushTopicRegistration.java
Log:
Add serialVersionUID to classes missing it.
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnknownMediaType.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnknownMediaType.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnknownMediaType.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -6,6 +6,8 @@
*/
public class UnknownMediaType extends RuntimeException
{
+ private static final long serialVersionUID = -1445038845165315001L;
+
public UnknownMediaType(String s)
{
super(s);
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnmarshalException.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnmarshalException.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/UnmarshalException.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -6,6 +6,8 @@
*/
public class UnmarshalException extends RuntimeException
{
+ private static final long serialVersionUID = 3932027442263719425L;
+
public UnmarshalException(String s)
{
super(s);
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/Authentication.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/Authentication.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/Authentication.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,10 +1,11 @@
package org.hornetq.rest.queue.push.xml;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -14,6 +15,7 @@
@XmlAccessorType(XmlAccessType.PROPERTY)
public class Authentication implements Serializable
{
+ private static final long serialVersionUID = -6218446923598032634L;
private AuthenticationType type;
@XmlElementRef
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/AuthenticationType.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/AuthenticationType.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/AuthenticationType.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,8 +1,9 @@
package org.hornetq.rest.queue.push.xml;
-import javax.xml.bind.annotation.XmlSeeAlso;
import java.io.Serializable;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
@@ -10,4 +11,5 @@
@XmlSeeAlso({BasicAuth.class, DigestAuth.class})
public class AuthenticationType implements Serializable
{
+ private static final long serialVersionUID = -4856752055689300045L;
}
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/BasicAuth.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/BasicAuth.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/BasicAuth.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -11,6 +11,7 @@
@XmlType(propOrder = {"username", "password"})
public class BasicAuth extends AuthenticationType
{
+ private static final long serialVersionUID = 2052716241089832934L;
private String username;
private String password;
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/DigestAuth.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/DigestAuth.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/DigestAuth.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -9,4 +9,5 @@
@XmlRootElement(name = "digest")
public class DigestAuth extends BasicAuth
{
+ private static final long serialVersionUID = 1857805131477468686L;
}
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/PushRegistration.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/PushRegistration.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/PushRegistration.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,5 +1,9 @@
package org.hornetq.rest.queue.push.xml;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -8,9 +12,6 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -21,6 +22,7 @@
@XmlType(propOrder = {"enabled", "destination", "durable", "selector", "target", "maxRetries", "retryWaitMillis", "disableOnFailure", "authenticationMechanism", "headers"})
public class PushRegistration implements Serializable
{
+ private static final long serialVersionUID = -2749818399978544262L;
private String id;
private boolean durable;
private XmlLink target;
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlHttpHeader.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlHttpHeader.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlHttpHeader.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,11 +1,12 @@
package org.hornetq.rest.queue.push.xml;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
-import java.io.Serializable;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -15,6 +16,7 @@
@XmlAccessorType(XmlAccessType.PROPERTY)
public class XmlHttpHeader implements Serializable
{
+ private static final long serialVersionUID = -390039194544718601L;
private String name;
private String value;
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlLink.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlLink.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/xml/XmlLink.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,10 +1,11 @@
package org.hornetq.rest.queue.push.xml;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -14,6 +15,7 @@
@XmlAccessorType(XmlAccessType.PROPERTY)
public class XmlLink implements Serializable
{
+ private static final long serialVersionUID = -6517264072911034419L;
protected String method;
protected String className;
protected String rel;
Modified: trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/PushTopicRegistration.java
===================================================================
--- trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/PushTopicRegistration.java 2011-11-02 16:16:50 UTC (rev 11633)
+++ trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/topic/PushTopicRegistration.java 2011-11-02 16:17:20 UTC (rev 11634)
@@ -1,13 +1,13 @@
package org.hornetq.rest.topic;
-import org.hornetq.rest.queue.push.xml.PushRegistration;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+import org.hornetq.rest.queue.push.xml.PushRegistration;
+
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
@@ -17,6 +17,7 @@
@XmlType(propOrder = {"topic"})
public class PushTopicRegistration extends PushRegistration
{
+ private static final long serialVersionUID = -2526239344680405891L;
private String topic;
@XmlElement
12 years, 7 months