JBoss hornetq SVN: r12085 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-06 06:46:58 -0500 (Mon, 06 Feb 2012)
New Revision: 12085
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java
Log:
HORNETQ-820 Restore hanging IO fix lost after merge from 2.2.
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java 2012-02-03 16:05:31 UTC (rev 12084)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java 2012-02-06 11:46:58 UTC (rev 12085)
@@ -35,7 +35,8 @@
private volatile String errorMessage;
private volatile int errorCode = 0;
-
+
+ @Override
public String toString()
{
return "simpleWaitIOCallback";
@@ -60,7 +61,11 @@
@Override
public void waitCompletion() throws Exception
{
- latch.await();
+ while (true)
+ {
+ if (latch.await(2, TimeUnit.SECONDS))
+ break;
+ }
if (errorMessage != null)
{
12 years, 11 months
JBoss hornetq SVN: r12084 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 11:05:31 -0500 (Fri, 03 Feb 2012)
New Revision: 12084
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
Log:
HORNETQ-720 Add test for sync start while the live is receiving largeMessage data.
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java 2012-02-03 13:28:27 UTC (rev 12083)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java 2012-02-03 16:05:31 UTC (rev 12084)
@@ -3,10 +3,17 @@
import java.io.File;
import java.util.HashSet;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ServerLocatorInternal;
+import org.hornetq.tests.util.UnitTestCase;
public class BackupSyncLargeMessageTest extends BackupSyncJournalTest
{
@@ -41,6 +48,7 @@
createProducerSendSomeMessages();
startBackupFinishSyncing();
receiveMsgsInRange(0, n_msgs / 2);
+ backupServer.stop();
assertEquals("we really ought to delete these after delivery", n_msgs / 2, getAllMessageFileIds(dir).size());
}
@@ -61,6 +69,54 @@
assertEquals("we really ought to delete these after delivery", n_msgs / 2, getAllMessageFileIds(dir).size());
}
+ /**
+ * LargeMessages are passed from the client to the server in chunks. Here we test the backup
+ * starting the data synchronization with the live in the middle of a multiple chunks large
+ * message upload from the client to the live server.
+ * @throws Exception
+ */
+ public void testBackupStartsWhenLiveIsReceivingLargeMessage() throws Exception
+ {
+ final ClientSession session = addClientSession(sessionFactory.createSession(true, true));
+ session.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);
+ final ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
+ final ClientMessage message = session.createMessage(true);
+ message.setBodyInputStream(UnitTestCase.createFakeLargeStream(1000 * MIN_LARGE_MESSAGE));
+
+ final AtomicBoolean caughtException = new AtomicBoolean(false);
+ final CountDownLatch latch = new CountDownLatch(1);
+ final CountDownLatch latch2 = new CountDownLatch(1);
+
+ Runnable r = new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ latch.countDown();
+ producer.send(message);
+ session.commit();
+ }
+ catch (HornetQException e)
+ {
+ e.printStackTrace();
+ caughtException.set(true);
+ }
+ finally
+ {
+ latch2.countDown();
+ }
+ }
+ };
+ Executors.defaultThreadFactory().newThread(r).start();
+ latch.await();
+ startBackupFinishSyncing();
+ latch2.await();
+ crash(session);
+ assertFalse("no exceptions while sending message", caughtException.get());
+ }
+
private Set<Long> getAllMessageFileIds(File dir)
{
Set<Long> idsOnBkp = new HashSet<Long>();
12 years, 11 months
JBoss hornetq SVN: r12083 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:28:27 -0500 (Fri, 03 Feb 2012)
New Revision: 12083
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/TimedBuffer.java
Log:
Remove spurious null check.
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/TimedBuffer.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/TimedBuffer.java 2012-02-03 13:28:11 UTC (rev 12082)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/TimedBuffer.java 2012-02-03 13:28:27 UTC (rev 12083)
@@ -293,7 +293,7 @@
flush(false);
}
- /**
+ /**
* force means the Journal is moving to a new file. Any pending write need to be done immediately
* or data could be lost
* */
@@ -323,10 +323,7 @@
bufferToFlush.put(buffer.toByteBuffer().array(), 0, pos);
- if (bufferToFlush != null)
- {
- bufferObserver.flushBuffer(bufferToFlush, pendingSync, callbacks);
- }
+ bufferObserver.flushBuffer(bufferToFlush, pendingSync, callbacks);
if (spinning)
{
12 years, 11 months
JBoss hornetq SVN: r12082 - in trunk/tests/integration-tests/src/test/java/org/hornetq/tests: largemessage and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:28:11 -0500 (Fri, 03 Feb 2012)
New Revision: 12082
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/largemessage/LargeMessageTestBase.java
Log:
improve tearDown
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java 2012-02-03 13:27:53 UTC (rev 12081)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionFactoryOnGCest.java 2012-02-03 13:28:11 UTC (rev 12082)
@@ -12,23 +12,14 @@
*/
package org.hornetq.tests.integration.jms.connection;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintStream;
-import java.io.StringReader;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.client.impl.ServerLocatorImpl;
-import org.hornetq.core.logging.Logger;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.tests.util.JMSTestBase;
@@ -42,20 +33,7 @@
*/
public class CloseConnectionFactoryOnGCest extends JMSTestBase
{
- private static final Logger log = Logger.getLogger(CloseConnectionFactoryOnGCest.class);
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
public void testCloseCFOnGC() throws Exception
{
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java 2012-02-03 13:27:53 UTC (rev 12081)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java 2012-02-03 13:28:11 UTC (rev 12082)
@@ -23,17 +23,16 @@
import junit.framework.Assert;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
-import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.CloseListener;
+import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.util.JMSTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* A CloseConnectionOnGCTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -42,8 +41,6 @@
*/
public class CloseConnectionOnGCTest extends JMSTestBase
{
- private static final Logger log = Logger.getLogger(CloseConnectionOnGCTest.class);
-
private HornetQConnectionFactory cf;
@Override
@@ -51,7 +48,7 @@
{
super.setUp();
- cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+ cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
cf.setBlockOnDurableSend(true);
cf.setPreAcknowledge(true);
}
@@ -59,7 +56,8 @@
@Override
protected void tearDown() throws Exception
{
- cf = null;
+ if (cf != null)
+ cf.close();
super.tearDown();
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/largemessage/LargeMessageTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/largemessage/LargeMessageTestBase.java 2012-02-03 13:27:53 UTC (rev 12081)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/largemessage/LargeMessageTestBase.java 2012-02-03 13:28:11 UTC (rev 12082)
@@ -69,18 +69,7 @@
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
-
- public LargeMessageTestBase(String test)
- {
- super(test);
- }
-
- public LargeMessageTestBase()
- {
- super();
- }
-
@Override
protected void tearDown() throws Exception
{
12 years, 11 months
JBoss hornetq SVN: r12081 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:27:53 -0500 (Fri, 03 Feb 2012)
New Revision: 12081
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/StoreConfigTest.java
Log:
Restore: improved test code, only catch the expected exception
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/StoreConfigTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/StoreConfigTest.java 2012-02-03 13:27:36 UTC (rev 12080)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/StoreConfigTest.java 2012-02-03 13:27:53 UTC (rev 12081)
@@ -74,17 +74,15 @@
jmsServer.createConnectionFactory(false, nonPersisted, "/nonPersisted" );
- boolean ex = false;
try
{
jmsServer.addConnectionFactoryToJNDI("np", "/someCF");
+ fail("Failure expected and the API let duplicates");
}
- catch (Exception expected)
+ catch (HornetQException expected)
{
- ex = true;
+ // expected
}
-
- assertTrue(ex);
openCon("/someCF");
@@ -104,18 +102,15 @@
jmsServer.start();
jmsServer.addConnectionFactoryToJNDI("tst", "/newJNDI");
-
- ex = false;
try
{
jmsServer.addConnectionFactoryToJNDI("tst", "/newJNDI");
+ fail("Failure expected and the API let duplicates");
}
- catch (Exception expected)
+ catch (HornetQException expected)
{
- ex = true;
+ // expected
}
- assertTrue(ex);
-
openCon("/someCF");
openCon("/someCF2");
openCon("/newJNDI");
12 years, 11 months
JBoss hornetq SVN: r12080 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:27:36 -0500 (Fri, 03 Feb 2012)
New Revision: 12080
Removed:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadRandomReattachTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadReattachSupport.java
Log:
Delete unused test classes.
Deleted: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadRandomReattachTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadRandomReattachTestBase.java 2012-02-03 13:27:19 UTC (rev 12079)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadRandomReattachTestBase.java 2012-02-03 13:27:36 UTC (rev 12080)
@@ -1,1476 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.cluster.reattach;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import junit.framework.Assert;
-
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientConsumer;
-import org.hornetq.api.core.client.ClientMessage;
-import org.hornetq.api.core.client.ClientProducer;
-import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.api.core.client.MessageHandler;
-import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.impl.invm.InVMRegistry;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.jms.client.HornetQBytesMessage;
-import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.RandomUtil;
-
-/**
- * A MultiThreadRandomReattachTestBase
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReattachSupport
-{
- private final Logger log = Logger.getLogger(getClass());
-
- // Constants -----------------------------------------------------
-
- private static final int RECEIVE_TIMEOUT = 30000;
-
- private final int LATCH_WAIT = getLatchWait();
-
- private final int NUM_THREADS = getNumThreads();
-
- // Attributes ----------------------------------------------------
- protected static final SimpleString ADDRESS = new SimpleString("FailoverTestAddress");
-
- protected HornetQServer liveServer;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public void testA() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestA(sf, threadNum);
- }
- }, NUM_THREADS, false);
-
- }
-
- public void testB() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestB(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testC() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestC(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testD() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestD(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testE() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestE(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testF() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestF(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testG() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestG(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testH() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestH(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testI() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestI(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testJ() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestJ(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testK() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestK(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- public void testL() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestL(sf);
- }
- }, NUM_THREADS, true, 10);
- }
-
- // public void testM() throws Exception
- // {
- // runTestMultipleThreads(new RunnableT()
- // {
- // public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- // {
- // doTestM(sf, threadNum);
- // }
- // }, NUM_THREADS);
- // }
-
- public void testN() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestN(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- // Added do replicate HORNETQ-264
- public void testO() throws Exception
- {
- runTestMultipleThreads(new RunnableT()
- {
- @Override
- public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- doTestO(sf, threadNum);
- }
- }, NUM_THREADS, false);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- @Override
- protected abstract void start() throws Exception;
-
- protected abstract void setBody(ClientMessage message) throws Exception;
-
- protected abstract boolean checkSize(ClientMessage message);
-
- protected ClientSession createAutoCommitSession(final ClientSessionFactory sf) throws Exception
- {
- ClientSession session = sf.createSession(false, true, true);
- session.addMetaData("someData", RandomUtil.randomString());
- session.addMetaData("someData2", RandomUtil.randomString());
- return session;
- }
-
- protected ClientSession createTransactionalSession(final ClientSessionFactory sf) throws Exception
- {
- ClientSession session = sf.createSession(false, false, false);
- session.addMetaData("someData", RandomUtil.randomString());
- session.addMetaData("someData2", RandomUtil.randomString());
-
- return session;
- }
-
- protected void doTestA(final ClientSessionFactory sf, final int threadNum, final ClientSession session2) throws Exception
- {
- SimpleString subName = new SimpleString("sub" + threadNum);
-
- ClientSession session = sf.createSession(false, true, true);
-
- session.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientProducer producer = session.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- ClientConsumer consumer = session.createConsumer(subName);
-
- final int numMessages = 100;
-
- sendMessages(session, producer, numMessages, threadNum);
-
- session.start();
-
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed: " + handler.failure);
- }
-
- producer.close();
-
- consumer.close();
-
- session.deleteQueue(subName);
-
- session.close();
- }
-
- protected void doTestA(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = createAutoCommitSession(sf);
-
- sessConsume.start();
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
-
- }
-
- ClientSession sessSend = sf.createSession(false, true, true);
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- Set<MyHandler> handlers = new HashSet<MyHandler>();
-
- for (ClientConsumer consumer : consumers)
- {
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- handlers.add(handler);
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed: " + handler.failure);
- }
- }
-
- sessSend.close();
-
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestB(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = createAutoCommitSession(sf);
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, true, true);
- sessSend.addMetaData("some-data", RandomUtil.randomString());
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.start();
- }
-
- Set<MyHandler> handlers = new HashSet<MyHandler>();
-
- for (ClientConsumer consumer : consumers)
- {
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- handlers.add(handler);
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed: " + handler.failure);
- }
- }
-
- sessSend.close();
-
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
-
- }
-
- protected void doTestC(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("some-data", RandomUtil.randomString());
-
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = createTransactionalSession(sf);
-
- sessConsume.start();
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, false, false);
- sessSend.addMetaData("some-data", RandomUtil.randomString());
-
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.rollback();
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.commit();
-
- Set<MyHandler> handlers = new HashSet<MyHandler>();
-
- for (ClientConsumer consumer : consumers)
- {
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- handlers.add(handler);
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed: " + handler.failure);
- }
-
- handler.reset();
- }
-
- for (ClientSession session : sessions)
- {
- session.rollback();
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- Assert.assertTrue(ok);
- }
-
- for (ClientSession session : sessions)
- {
- session.commit();
- }
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestD(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("some-data", RandomUtil.randomString());
-
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + " sub" + i);
-
- ClientSession sessConsume = sf.createSession(false, false, false);
- sessConsume.addMetaData("data", RandomUtil.randomString());
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, false, false);
- sessSend.addMetaData("some-data", RandomUtil.randomString());
-
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.rollback();
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.commit();
-
- for (ClientSession session : sessions)
- {
- session.start();
- }
-
- Set<MyHandler> handlers = new HashSet<MyHandler>();
-
- for (ClientConsumer consumer : consumers)
- {
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- handlers.add(handler);
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed: " + handler.failure);
- }
- }
-
- handlers.clear();
-
- // Set handlers to null
- for (ClientConsumer consumer : consumers)
- {
- consumer.setMessageHandler(null);
- }
-
- for (ClientSession session : sessions)
- {
- session.rollback();
- }
-
- // New handlers
- for (ClientConsumer consumer : consumers)
- {
- MyHandler handler = new MyHandler(threadNum, numMessages);
-
- consumer.setMessageHandler(handler);
-
- handlers.add(handler);
- }
-
- for (MyHandler handler : handlers)
- {
- boolean ok = handler.latch.await(LATCH_WAIT, TimeUnit.MILLISECONDS);
-
- if (!ok)
- {
- throw new Exception("Timed out waiting for messages on handler " + System.identityHashCode(handler) +
- " threadnum " +
- threadNum);
- }
-
- if (handler.failure != null)
- {
- throw new Exception("Handler failed on rollback: " + handler.failure);
- }
- }
-
- for (ClientSession session : sessions)
- {
- session.commit();
- }
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + " sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- // Now with synchronous receive()
-
- protected void doTestE(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("some-data", RandomUtil.randomString());
-
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = sf.createSession(false, true, true);
- sessConsume.addMetaData("some-data", RandomUtil.randomString());
-
-
- sessConsume.start();
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, true, true);
- sessSend.addMetaData("some-data", RandomUtil.randomString());
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- consumeMessages(consumers, numMessages, threadNum);
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestF(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("data", RandomUtil.randomString());
-
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = sf.createSession(false, true, true);
- sessConsume.addMetaData("data", RandomUtil.randomString());
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, true, true);
- sessSend.addMetaData("data", RandomUtil.randomString());
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.start();
- }
-
- consumeMessages(consumers, numMessages, threadNum);
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestG(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("data", RandomUtil.randomString());
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = sf.createSession(false, false, false);
- sessConsume.addMetaData("data", RandomUtil.randomString());
-
-
- sessConsume.start();
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, false, false);
- sessSend.addMetaData("data", RandomUtil.randomString());
-
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.rollback();
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.commit();
-
- consumeMessages(consumers, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.rollback();
- }
-
- consumeMessages(consumers, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.commit();
- }
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestH(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- long start = System.currentTimeMillis();
-
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("data", RandomUtil.randomString());
-
-
- final int numMessages = 100;
-
- final int numSessions = 10;
-
- Set<ClientConsumer> consumers = new HashSet<ClientConsumer>();
- Set<ClientSession> sessions = new HashSet<ClientSession>();
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- ClientSession sessConsume = sf.createSession(false, false, false);
- sessConsume.addMetaData("data", RandomUtil.randomString());
-
-
- sessConsume.createQueue(MultiThreadRandomReattachTestBase.ADDRESS, subName, null, false);
-
- ClientConsumer consumer = sessConsume.createConsumer(subName);
-
- consumers.add(consumer);
-
- sessions.add(sessConsume);
- }
-
- ClientSession sessSend = sf.createSession(false, false, false);
- sessSend.addMetaData("data", RandomUtil.randomString());
-
- ClientProducer producer = sessSend.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.rollback();
-
- sendMessages(sessSend, producer, numMessages, threadNum);
-
- sessSend.commit();
-
- for (ClientSession session : sessions)
- {
- session.start();
- }
-
- consumeMessages(consumers, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.rollback();
- }
-
- consumeMessages(consumers, numMessages, threadNum);
-
- for (ClientSession session : sessions)
- {
- session.commit();
- }
-
- sessSend.close();
- for (ClientSession session : sessions)
- {
- session.close();
- }
-
- for (int i = 0; i < numSessions; i++)
- {
- SimpleString subName = new SimpleString(threadNum + "sub" + i);
-
- s.deleteQueue(subName);
- }
-
- s.close();
-
- long end = System.currentTimeMillis();
-
- log.info("duration " + (end - start));
- }
-
- protected void doTestI(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- ClientSession sessCreate = sf.createSession(false, true, true);
- sessCreate.addMetaData("data", RandomUtil.randomString());
-
-
- sessCreate.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
- new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
- null,
- false);
-
- ClientSession sess = sf.createSession(false, true, true);
- sess.addMetaData("data", RandomUtil.randomString());
-
-
- sess.start();
-
- ClientConsumer consumer = sess.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
- producer.send(message);
-
- ClientMessage message2 = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
-
- Assert.assertNotNull(message2);
-
- message2.acknowledge();
-
- sess.close();
-
- sessCreate.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- sessCreate.close();
- }
-
- protected void doTestJ(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- ClientSession sessCreate = sf.createSession(false, true, true);
- sessCreate.addMetaData("data", RandomUtil.randomString());
-
-
- sessCreate.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
- new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
- null,
- false);
-
- ClientSession sess = sf.createSession(false, true, true);
- sess.addMetaData("data", RandomUtil.randomString());
-
- sess.start();
-
- ClientConsumer consumer = sess.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
- producer.send(message);
-
- ClientMessage message2 = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
-
- Assert.assertNotNull(message2);
-
- message2.acknowledge();
-
- sess.close();
-
- sessCreate.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- sessCreate.close();
- }
-
- protected void doTestK(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- ClientSession s = sf.createSession(false, false, false);
- s.addMetaData("data", RandomUtil.randomString());
-
- s.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
- new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
- null,
- false);
-
- final int numConsumers = 100;
-
- for (int i = 0; i < numConsumers; i++)
- {
- ClientConsumer consumer = s.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- consumer.close();
- }
-
- s.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- s.close();
- }
-
- /*
- * This test tests failure during create connection
- */
- protected void doTestL(final ClientSessionFactory sf) throws Exception
- {
- final int numSessions = 100;
-
- for (int i = 0; i < numSessions; i++)
- {
- ClientSession session = sf.createSession(false, false, false);
-
- session.addMetaData("data", RandomUtil.randomString());
-
- session.close();
- }
- }
-
- protected void doTestN(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- ClientSession sessCreate = sf.createSession(false, true, true);
-
- sessCreate.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
- new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
- null,
- false);
-
- ClientSession sess = sf.createSession(false, true, true);
- sess.addMetaData("data", RandomUtil.randomString());
-
- sess.stop();
-
- sess.start();
-
- sess.stop();
-
- ClientConsumer consumer = sess.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
-
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
- producer.send(message);
-
- sess.start();
-
- ClientMessage message2 = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
-
- Assert.assertNotNull(message2);
-
- message2.acknowledge();
-
- sess.stop();
-
- sess.start();
-
- sess.close();
-
- sessCreate.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- sessCreate.close();
- }
-
- protected void doTestO(final ClientSessionFactory sf, final int threadNum) throws Exception
- {
- ClientSession sessCreate = sf.createSession(false, true, true);
-
- sessCreate.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
- new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
- null,
- false);
-
- ClientSession sess = sf.createSession(false, true, true);
-
- sess.start();
-
- ClientConsumer consumer = sess.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- for (int i = 0; i < 100; i++)
- {
- Assert.assertNull(consumer.receiveImmediate());
- }
-
- sess.close();
-
- sessCreate.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
-
- sessCreate.close();
- }
-
- protected int getLatchWait()
- {
- return 60000;
- }
-
- protected int getNumIterations()
- {
- return 2;
- }
-
- protected int getNumThreads()
- {
- return 10;
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- log.info("************ Starting test " + getName());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- if (liveServer != null && liveServer.isStarted())
- {
- liveServer.stop();
- }
-
- liveServer = null;
-
- super.tearDown();
- }
-
- // Private -------------------------------------------------------
-
- private void runTestMultipleThreads(final RunnableT runnable,
- final int numThreads,
- final boolean failOnCreateConnection) throws Exception
- {
- runTestMultipleThreads(runnable, numThreads, failOnCreateConnection, 1000);
- }
-
- private void runTestMultipleThreads(final RunnableT runnable,
- final int numThreads,
- final boolean failOnCreateConnection,
- final long failDelay) throws Exception
- {
-
- runMultipleThreadsFailoverTest(runnable, numThreads, getNumIterations(), failOnCreateConnection, failDelay);
- }
-
- /**
- * @return
- */
- @Override
- protected ServerLocator createLocator() throws Exception
- {
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
- locator.setReconnectAttempts(-1);
- locator.setConfirmationWindowSize(1024 * 1024);
- return addServerLocator(locator);
- }
-
- @Override
- protected void stop() throws Exception
- {
- liveServer.stop();
-
- System.gc();
-
- Assert.assertEquals(0, InVMRegistry.instance.size());
- }
-
- private void sendMessages(final ClientSession sessSend,
- final ClientProducer producer,
- final int numMessages,
- final int threadNum) throws Exception
- {
- for (int i = 0; i < numMessages; i++)
- {
- ClientMessage message = sessSend.createMessage(HornetQBytesMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.putIntProperty(new SimpleString("threadnum"), threadNum);
- message.putIntProperty(new SimpleString("count"), i);
- setBody(message);
- producer.send(message);
- }
- }
-
- private void consumeMessages(final Set<ClientConsumer> consumers, final int numMessages, final int threadNum) throws Exception
- {
- // We make sure the messages arrive in the order they were sent from a particular producer
- Map<ClientConsumer, Map<Integer, Integer>> counts = new HashMap<ClientConsumer, Map<Integer, Integer>>();
-
- for (int i = 0; i < numMessages; i++)
- {
- for (ClientConsumer consumer : consumers)
- {
- Map<Integer, Integer> consumerCounts = counts.get(consumer);
-
- if (consumerCounts == null)
- {
- consumerCounts = new HashMap<Integer, Integer>();
- counts.put(consumer, consumerCounts);
- }
-
- ClientMessage msg = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
-
- Assert.assertNotNull(msg);
-
- int tn = (Integer)msg.getObjectProperty(new SimpleString("threadnum"));
- int cnt = (Integer)msg.getObjectProperty(new SimpleString("count"));
-
- Integer c = consumerCounts.get(tn);
- if (c == null)
- {
- c = new Integer(cnt);
- }
-
- if (tn == threadNum && cnt != c.intValue())
- {
- throw new Exception("Invalid count, expected " + tn + ": " + c + " got " + cnt);
- }
-
- c++;
-
- // Wrap
- if (c == numMessages)
- {
- c = 0;
- }
-
- consumerCounts.put(tn, c);
-
- msg.acknowledge();
- }
- }
- }
-
- // Inner classes -------------------------------------------------
-
- private class MyHandler implements MessageHandler
- {
- CountDownLatch latch = new CountDownLatch(1);
-
- private final Map<Integer, Integer> counts = new HashMap<Integer, Integer>();
-
- volatile String failure;
-
- final int tn;
-
- final int numMessages;
-
- volatile boolean done;
-
- synchronized void reset()
- {
- counts.clear();
-
- done = false;
-
- failure = null;
-
- latch = new CountDownLatch(1);
- }
-
- MyHandler(final int threadNum, final int numMessages)
- {
- tn = threadNum;
-
- this.numMessages = numMessages;
- }
-
- public synchronized void onMessage(final ClientMessage message)
- {
- try
- {
- message.acknowledge();
- }
- catch (HornetQException me)
- {
- log.error("Failed to process", me);
- }
-
- if (done)
- {
- return;
- }
-
- int threadNum = (Integer)message.getObjectProperty(new SimpleString("threadnum"));
- int cnt = (Integer)message.getObjectProperty(new SimpleString("count"));
-
- Integer c = counts.get(threadNum);
- if (c == null)
- {
- c = new Integer(cnt);
- }
-
- if (tn == threadNum && cnt != c.intValue())
- {
- failure = "Invalid count, expected " + threadNum + ":" + c + " got " + cnt;
- log.error(failure);
-
- latch.countDown();
- }
-
- if (!checkSize(message))
- {
- failure = "Invalid size on message";
- log.error(failure);
- latch.countDown();
- }
-
- if (tn == threadNum && c == numMessages - 1)
- {
- done = true;
- latch.countDown();
- }
-
- c++;
- // Wrap around at numMessages
- if (c == numMessages)
- {
- c = 0;
- }
-
- counts.put(threadNum, c);
-
- }
- }
-}
\ No newline at end of file
Deleted: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadReattachSupport.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadReattachSupport.java 2012-02-03 13:27:19 UTC (rev 12079)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/cluster/reattach/MultiThreadReattachSupport.java 2012-02-03 13:27:36 UTC (rev 12080)
@@ -1,281 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.cluster.reattach;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import junit.framework.Assert;
-
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
-import org.hornetq.core.client.impl.ClientSessionInternal;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.impl.RemotingConnectionImpl;
-import org.hornetq.core.remoting.impl.invm.InVMConnector;
-import org.hornetq.tests.util.ServiceTestBase;
-import org.hornetq.tests.util.UnitTestCase;
-
-/**
- * A MultiThreadFailoverSupport
- *
- * @author <a href="mailto:time.fox@jboss.org">Tim Fox</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- * Created Mar 17, 2009 11:15:02 AM
- *
- *
- */
-public abstract class MultiThreadReattachSupport extends ServiceTestBase
-{
-
- // Constants -----------------------------------------------------
-
- private final Logger log = Logger.getLogger(this.getClass());
-
- // Attributes ----------------------------------------------------
-
- private Timer timer;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- protected abstract void start() throws Exception;
-
- protected abstract void stop() throws Exception;
-
- protected abstract ServerLocator createLocator() throws Exception;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- timer = new Timer();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- timer.cancel();
- timer = null;
- super.tearDown();
- }
-
- protected boolean shouldFail()
- {
- return true;
- }
-
- protected void runMultipleThreadsFailoverTest(final RunnableT runnable,
- final int numThreads,
- final int numIts,
- final boolean failOnCreateConnection,
- final long failDelay) throws Exception
- {
- for (int its = 0; its < numIts; its++)
- {
- log.info("Beginning iteration " + its);
-
- start();
-
- final ServerLocator locator = createLocator();
-
- final ClientSessionFactoryInternal sf = (ClientSessionFactoryInternal) locator.createSessionFactory();
-
- final ClientSession session = sf.createSession(false, true, true);
-
- Failer failer = startFailer(failDelay, session, failOnCreateConnection);
-
- class Runner extends Thread
- {
- private volatile Throwable throwable;
-
- private final RunnableT test;
-
- private final int threadNum;
-
- Runner(final RunnableT test, final int threadNum)
- {
- this.test = test;
-
- this.threadNum = threadNum;
- }
-
- @Override
- public void run()
- {
- try
- {
- test.run(sf, threadNum);
- }
- catch (Throwable t)
- {
- throwable = t;
-
- log.error("Failed to run test", t);
-
- // Case a failure happened here, it should print the Thread dump
- // Sending it to System.out, as it would show on the Tests report
- System.out.println(UnitTestCase.threadDump(" - fired by MultiThreadRandomReattachTestBase::runTestMultipleThreads (" + t.getLocalizedMessage() +
- ")"));
- }
- }
- }
-
- do
- {
- List<Runner> threads = new ArrayList<Runner>();
-
- for (int i = 0; i < numThreads; i++)
- {
- Runner runner = new Runner(runnable, i);
-
- threads.add(runner);
-
- runner.start();
- }
-
- for (Runner thread : threads)
- {
- thread.join();
-
- if (thread.throwable != null)
- {
- throw new Exception("Exception on thread " + thread, thread.throwable);
- }
- }
-
- runnable.checkFail();
-
- }
- while (!failer.isExecuted());
-
- InVMConnector.resetFailures();
-
- session.close();
-
- locator.close();
-
- Assert.assertEquals(0, sf.numSessions());
-
- Assert.assertEquals(0, sf.numConnections());
-
- sf.close();
-
- stop();
- }
- }
-
- // Private -------------------------------------------------------
-
- private Failer startFailer(final long time, final ClientSession session, final boolean failOnCreateConnection)
- {
- Failer failer = new Failer(session, failOnCreateConnection);
-
- // This is useful for debugging.. just change shouldFail to return false, and Failer will not be executed
- if (shouldFail())
- {
- timer.schedule(failer, (long)(time * Math.random()), 100);
- }
-
- return failer;
- }
-
- // Inner classes -------------------------------------------------
-
- protected abstract class RunnableT extends Thread
- {
- private volatile String failReason;
-
- private volatile Throwable throwable;
-
- public void setFailed(final String reason, final Throwable throwable)
- {
- failReason = reason;
- this.throwable = throwable;
- }
-
- public void checkFail()
- {
- if (throwable != null)
- {
- log.error("Test failed: " + failReason, throwable);
- }
- if (failReason != null)
- {
- Assert.fail(failReason);
- }
- }
-
- public abstract void run(final ClientSessionFactory sf, final int threadNum) throws Exception;
- }
-
- private class Failer extends TimerTask
- {
- private final ClientSession session;
-
- private boolean executed;
-
- private final boolean failOnCreateConnection;
-
- public Failer(final ClientSession session, final boolean failOnCreateConnection)
- {
- this.session = session;
-
- this.failOnCreateConnection = failOnCreateConnection;
- }
-
- @Override
- public synchronized void run()
- {
- log.info("** Failing connection");
-
- RemotingConnectionImpl conn = (RemotingConnectionImpl)((ClientSessionInternal)session).getConnection();
-
- if (failOnCreateConnection)
- {
- InVMConnector.numberOfFailures = 1;
- InVMConnector.failOnCreateConnection = true;
- }
- else
- {
- conn.fail(new HornetQException(HornetQException.NOT_CONNECTED, "blah"));
- }
-
- log.info("** Fail complete");
-
- cancel();
-
- executed = true;
- }
-
- public synchronized boolean isExecuted()
- {
- return executed;
- }
- }
-
-}
12 years, 11 months
JBoss hornetq SVN: r12079 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:27:19 -0500 (Fri, 03 Feb 2012)
New Revision: 12079
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java
Log:
Restore: check returned codes, fixes findbugs warnings.
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2012-02-03 13:26:59 UTC (rev 12078)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2012-02-03 13:27:19 UTC (rev 12079)
@@ -23,6 +23,7 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.core.journal.EncodingSupport;
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.journal.SequentialFile;
@@ -102,9 +103,12 @@
close();
}
- file.delete();
+ if (!file.delete())
+ {
+ log.error("Failed to delete file " + this);
+ }
}
-
+
public void copyTo(SequentialFile newFileName) throws Exception
{
log.debug("Copying " + this + " as " + newFileName);
@@ -113,10 +117,10 @@
{
this.open();
}
-
-
+
+
ByteBuffer buffer = ByteBuffer.allocate(10 * 1024);
-
+
for (;;)
{
buffer.rewind();
@@ -148,7 +152,11 @@
if (!file.equals(newFile))
{
- file.renameTo(newFile);
+ if (!file.renameTo(newFile))
+ {
+ throw new HornetQException(HornetQException.IO_ERROR, "failed to rename file " + file.getName() + " to " +
+ newFileName);
+ }
file = newFile;
}
}
12 years, 11 months
JBoss hornetq SVN: r12078 - in trunk: hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl and 2 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-03 08:26:59 -0500 (Fri, 03 Feb 2012)
New Revision: 12078
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/FileLockNodeManager.java
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
Log:
Restore: decreased visibility
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 2012-02-03 13:11:56 UTC (rev 12077)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2012-02-03 13:26:59 UTC (rev 12078)
@@ -128,17 +128,17 @@
private static final long CHECKPOINT_BATCH_SIZE = Integer.MAX_VALUE;
// grouping journal record type
- public static final byte GROUP_RECORD = 20;
+ private static final byte GROUP_RECORD = 20;
// Bindings journal record type
- public static final byte QUEUE_BINDING_RECORD = 21;
+ private static final byte QUEUE_BINDING_RECORD = 21;
public static final byte ID_COUNTER_RECORD = 24;
- public static final byte ADDRESS_SETTING_RECORD = 25;
+ private static final byte ADDRESS_SETTING_RECORD = 25;
- public static final byte SECURITY_RECORD = 26;
+ private static final byte SECURITY_RECORD = 26;
// Message journal record types
@@ -146,29 +146,29 @@
// We use this to avoid temporary files missing
public static final byte ADD_LARGE_MESSAGE_PENDING = 29;
- public static final byte ADD_LARGE_MESSAGE = 30;
+ private static final byte ADD_LARGE_MESSAGE = 30;
- public static final byte ADD_MESSAGE = 31;
+ private static final byte ADD_MESSAGE = 31;
public static final byte ADD_REF = 32;
- public static final byte ACKNOWLEDGE_REF = 33;
+ private static final byte ACKNOWLEDGE_REF = 33;
public static final byte UPDATE_DELIVERY_COUNT = 34;
public static final byte PAGE_TRANSACTION = 35;
- public static final byte SET_SCHEDULED_DELIVERY_TIME = 36;
+ private static final byte SET_SCHEDULED_DELIVERY_TIME = 36;
- public static final byte DUPLICATE_ID = 37;
+ private static final byte DUPLICATE_ID = 37;
- public static final byte HEURISTIC_COMPLETION = 38;
+ private static final byte HEURISTIC_COMPLETION = 38;
public static final byte ACKNOWLEDGE_CURSOR = 39;
- public static final byte PAGE_CURSOR_COUNTER_VALUE = 40;
+ private static final byte PAGE_CURSOR_COUNTER_VALUE = 40;
- public static final byte PAGE_CURSOR_COUNTER_INC = 41;
+ private static final byte PAGE_CURSOR_COUNTER_INC = 41;
private final Semaphore pageMaxConcurrentIO;
@@ -2041,7 +2041,7 @@
describeJournal(bindingsFF, bindings);
}
- public static void describeMessagesJournal(final String messagesDir) throws Exception
+ static void describeMessagesJournal(final String messagesDir) throws Exception
{
SequentialFileFactory messagesFF = new NIOSequentialFileFactory(messagesDir, null);
@@ -2656,7 +2656,7 @@
}
}
- protected OperationContext getContext(final boolean sync)
+ private OperationContext getContext(final boolean sync)
{
if (sync)
{
@@ -2799,7 +2799,7 @@
}
}
- public static class HeuristicCompletionEncoding implements EncodingSupport
+ private static class HeuristicCompletionEncoding implements EncodingSupport
{
public Xid xid;
@@ -2839,7 +2839,7 @@
}
}
- public static class GroupingEncoding implements EncodingSupport, GroupingInfo
+ private static class GroupingEncoding implements EncodingSupport, GroupingInfo
{
public long id;
@@ -3145,17 +3145,12 @@
}
- public static class DeleteEncoding implements EncodingSupport
+ private static class DeleteEncoding implements EncodingSupport
{
public byte recordType;
public long id;
- public DeleteEncoding()
- {
- super();
- }
-
public DeleteEncoding(final byte recordType, final long id)
{
this.recordType = recordType;
@@ -3257,7 +3252,7 @@
}
}
- public static class ScheduledDeliveryEncoding extends QueueEncoding
+ private static class ScheduledDeliveryEncoding extends QueueEncoding
{
long scheduledDeliveryTime;
@@ -3810,7 +3805,7 @@
}
- public static class MessageDescribe
+ private static class MessageDescribe
{
public MessageDescribe(Message msg)
{
@@ -3859,7 +3854,7 @@
* @param buffer
* @return
*/
- protected static PersistedRoles newSecurityRecord(long id, HornetQBuffer buffer)
+ private static PersistedRoles newSecurityRecord(long id, HornetQBuffer buffer)
{
PersistedRoles roles = new PersistedRoles();
roles.decode(buffer);
@@ -3872,7 +3867,7 @@
* @param buffer
* @return
*/
- protected static PersistedAddressSetting newAddressEncoding(long id, HornetQBuffer buffer)
+ private static PersistedAddressSetting newAddressEncoding(long id, HornetQBuffer buffer)
{
PersistedAddressSetting setting = new PersistedAddressSetting();
setting.decode(buffer);
@@ -3885,7 +3880,7 @@
* @param buffer
* @return
*/
- protected static GroupingEncoding newGroupEncoding(long id, HornetQBuffer buffer)
+ private static GroupingEncoding newGroupEncoding(long id, HornetQBuffer buffer)
{
GroupingEncoding encoding = new GroupingEncoding();
encoding.decode(buffer);
@@ -3898,7 +3893,7 @@
* @param buffer
* @return
*/
- protected static PersistentQueueBindingEncoding newBindingEncoding(long id, HornetQBuffer buffer)
+ private static PersistentQueueBindingEncoding newBindingEncoding(long id, HornetQBuffer buffer)
{
PersistentQueueBindingEncoding bindingEncoding = new PersistentQueueBindingEncoding();
@@ -3918,7 +3913,7 @@
* @param journal
* @throws Exception
*/
- protected static void describeJournal(SequentialFileFactory fileFactory, JournalImpl journal) throws Exception
+ private static void describeJournal(SequentialFileFactory fileFactory, JournalImpl journal) throws Exception
{
List<JournalFile> files = journal.orderFiles();
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 2012-02-03 13:11:56 UTC (rev 12077)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2012-02-03 13:26:59 UTC (rev 12078)
@@ -57,7 +57,7 @@
*
*
*/
-public class CoreProtocolManager implements ProtocolManager
+class CoreProtocolManager implements ProtocolManager
{
private static final Logger log = Logger.getLogger(CoreProtocolManager.class);
@@ -67,7 +67,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;
@@ -269,12 +269,12 @@
private final Map<String, ServerSessionPacketHandler> sessionHandlers = new ConcurrentHashMap<String, ServerSessionPacketHandler>();
- public ServerSessionPacketHandler getSessionHandler(final String sessionName)
+ ServerSessionPacketHandler getSessionHandler(final String sessionName)
{
return sessionHandlers.get(sessionName);
}
- public void addSessionHandler(final String name, final ServerSessionPacketHandler handler)
+ void addSessionHandler(final String name, final ServerSessionPacketHandler handler)
{
sessionHandlers.put(name, handler);
}
@@ -294,4 +294,10 @@
{
return -1;
}
+
+ @Override
+ public String toString()
+ {
+ return "CoreProtocolManager(server=" + server + ")";
+ }
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/FileLockNodeManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/FileLockNodeManager.java 2012-02-03 13:11:56 UTC (rev 12077)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/FileLockNodeManager.java 2012-02-03 13:26:59 UTC (rev 12078)
@@ -35,7 +35,7 @@
{
private final Logger log = Logger.getLogger(this.getClass());
- protected static final String SERVER_LOCK_NAME = "server.lock";
+ private static final String SERVER_LOCK_NAME = "server.lock";
private static final String ACCESS_MODE = "rw";
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2012-02-03 13:11:56 UTC (rev 12077)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2012-02-03 13:26:59 UTC (rev 12078)
@@ -36,7 +36,7 @@
*
*
*/
-public abstract class AbstractSequentialFile implements SequentialFile
+abstract class AbstractSequentialFile implements SequentialFile
{
// Constants -----------------------------------------------------
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2012-02-03 13:11:56 UTC (rev 12077)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2012-02-03 13:26:59 UTC (rev 12078)
@@ -39,7 +39,7 @@
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
*/
-public abstract class AbstractSequentialFileFactory implements SequentialFileFactory
+abstract class AbstractSequentialFileFactory implements SequentialFileFactory
{
// Timeout used to wait executors to shutdown
@@ -64,7 +64,7 @@
* */
protected ExecutorService writeExecutor;
- public AbstractSequentialFileFactory(final String journalDir,
+ AbstractSequentialFileFactory(final String journalDir,
final boolean buffered,
final int bufferSize,
final int bufferTimeout,
12 years, 11 months
JBoss hornetq SVN: r12077 - tags.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-02-03 08:11:56 -0500 (Fri, 03 Feb 2012)
New Revision: 12077
Removed:
tags/HornetQ_2_2_11_AS7_Final_Pending/
Log:
deleted pending release for 2.2.11.Final
12 years, 11 months
JBoss hornetq SVN: r12076 - trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-02-03 07:09:30 -0500 (Fri, 03 Feb 2012)
New Revision: 12076
Modified:
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAProperties.java
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQResourceAdapter.java
Log:
https://issues.jboss.org/browse/HORNETQ-645 - removed primitive types
Modified: trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAProperties.java
===================================================================
--- trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAProperties.java 2012-02-03 11:51:32 UTC (rev 12075)
+++ trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQRAProperties.java 2012-02-03 12:09:30 UTC (rev 12076)
@@ -143,7 +143,7 @@
/**
* @param value the useJNDI to set
*/
- public void setUseJNDI(final boolean value)
+ public void setUseJNDI(final Boolean value)
{
useJNDI = value;
}
@@ -216,7 +216,7 @@
return setupAttempts;
}
- public void setSetupAttempts(int setupAttempts)
+ public void setSetupAttempts(Integer setupAttempts)
{
this.setupAttempts = setupAttempts;
}
@@ -226,7 +226,7 @@
return setupInterval;
}
- public void setSetupInterval(long setupInterval)
+ public void setSetupInterval(Long setupInterval)
{
this.setupInterval = setupInterval;
}
Modified: trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQResourceAdapter.java 2012-02-03 11:51:32 UTC (rev 12075)
+++ trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/HornetQResourceAdapter.java 2012-02-03 12:09:30 UTC (rev 12076)
@@ -1125,7 +1125,7 @@
/**
* @param value the useJNDI to set
*/
- public void setUseJNDI(final boolean value)
+ public void setUseJNDI(final Boolean value)
{
raProperties.setUseJNDI(value);
}
@@ -1218,7 +1218,7 @@
return raProperties.getSetupAttempts();
}
- public void setSetupAttempts(int setupAttempts)
+ public void setSetupAttempts(Integer setupAttempts)
{
if (HornetQResourceAdapter.trace)
{
@@ -1236,7 +1236,7 @@
return raProperties.getSetupInterval();
}
- public void setSetupInterval(long interval)
+ public void setSetupInterval(Long interval)
{
if (HornetQResourceAdapter.trace)
{
12 years, 11 months