[jboss-cvs] JBoss Messaging SVN: r1816 - in trunk: src/main/org/jboss/jms/client/delegate src/main/org/jboss/jms/message src/main/org/jboss/jms/server src/main/org/jboss/jms/server/destination src/main/org/jboss/jms/server/endpoint src/main/org/jboss/jms/server/endpoint/advised src/main/org/jboss/jms/server/remoting src/main/org/jboss/jms/util src/main/org/jboss/messaging/core src/main/org/jboss/messaging/core/plugin src/main/org/jboss/messaging/core/plugin/postoffice src/main/org/jboss/messaging/core/plugin/postoffice/cluster src/main/org/jboss/messaging/core/tx tests/bin tests/src/org/jboss/test/messaging/core tests/src/org/jboss/test/messaging/core/local/base tests/src/org/jboss/test/messaging/core/paging tests/src/org/jboss/test/messaging/core/paging/base tests/src/org/jboss/test/messaging/core/plugin tests/src/org/jboss/test/messaging/core/plugin/base tests/src/org/jboss/test/messaging/core/plugin/postoffice tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluste! r tests/src/org/jboss/test/messaging/jms tests/src/org/jboss/test/messaging/jms/clustering
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 19 00:15:28 EST 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-12-19 00:15:12 -0500 (Tue, 19 Dec 2006)
New Revision: 1816
Modified:
trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
trunk/src/main/org/jboss/jms/message/MessageIdGenerator.java
trunk/src/main/org/jboss/jms/server/ServerPeer.java
trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
trunk/src/main/org/jboss/jms/server/destination/QueueService.java
trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
trunk/src/main/org/jboss/jms/util/MessageQueueNameHelper.java
trunk/src/main/org/jboss/messaging/core/Channel.java
trunk/src/main/org/jboss/messaging/core/plugin/IdBlock.java
trunk/src/main/org/jboss/messaging/core/plugin/IdManager.java
trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBindings.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredBindings.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultRouter.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/LocalClusteredQueue.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/RemoteQueueStub.java
trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/SendTransactionRequest.java
trunk/src/main/org/jboss/messaging/core/tx/Transaction.java
trunk/src/main/org/jboss/messaging/core/tx/TransactionRepository.java
trunk/tests/bin/runtest
trunk/tests/src/org/jboss/test/messaging/core/SimpleDeliveryTest.java
trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java
trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java
trunk/tests/src/org/jboss/test/messaging/core/paging/base/PagingStateTestBase.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/IdManagerTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/JDBCPersistenceManagerTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
trunk/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java
trunk/tests/src/org/jboss/test/messaging/jms/clustering/DistributedDestinationsTest.java
Log:
various refactorings and logging improvments
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -41,7 +41,7 @@
import org.jboss.jms.server.remoting.MessagingMarshallable;
import org.jboss.jms.server.remoting.MetaDataConstants;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
@@ -144,7 +144,7 @@
* server-side endpoint.
* @see org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint#getIdBlock(int)
*/
- public IdBlock getIdBlock(int size)
+ public IDBlock getIdBlock(int size)
{
throw new IllegalStateException("This invocation should not be handled here!");
}
Modified: trunk/src/main/org/jboss/jms/message/MessageIdGenerator.java
===================================================================
--- trunk/src/main/org/jboss/jms/message/MessageIdGenerator.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/message/MessageIdGenerator.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -25,7 +25,7 @@
import org.jboss.jms.delegate.ConnectionFactoryDelegate;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
/**
*
@@ -74,7 +74,7 @@
protected void getNextBlock() throws JMSException
{
- IdBlock block = cfd.getIdBlock(blockSize);
+ IDBlock block = cfd.getIdBlock(blockSize);
nextID = block.getLow();
high = block.getHigh();
Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -47,7 +47,7 @@
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.memory.MemoryManager;
import org.jboss.messaging.core.memory.SimpleMemoryManager;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -126,9 +126,9 @@
private TransactionRepository txRepository;
private ConnectionManager connectionManager;
private ConnectorManager connectorManager;
- private IdManager messageIdManager;
- private IdManager channelIdManager;
- private IdManager transactionIdManager;
+ private IDManager messageIDManager;
+ private IDManager channelIDManager;
+ private IDManager transactionIDManager;
private MemoryManager memoryManager;
private QueuedExecutorPool queuedExecutorPool;
private MessageStore messageStore;
@@ -211,22 +211,22 @@
//MBean dependencies
// Create the wired components
- messageIdManager = new IdManager("MESSAGE_ID", 4096, persistenceManager);
- channelIdManager = new IdManager("CHANNEL_ID", 10, persistenceManager);
- transactionIdManager = new IdManager("TRANSACTION_ID", 1024, persistenceManager);
+ messageIDManager = new IDManager("MESSAGE_ID", 4096, persistenceManager);
+ channelIDManager = new IDManager("CHANNEL_ID", 10, persistenceManager);
+ transactionIDManager = new IDManager("TRANSACTION_ID", 1024, persistenceManager);
destinationJNDIMapper = new DestinationJNDIMapper(this);
connFactoryJNDIMapper = new ConnectionFactoryJNDIMapper(this);
connectionManager = new SimpleConnectionManager();
connectorManager = new SimpleConnectorManager();
memoryManager = new SimpleMemoryManager();
messageStore = new SimpleMessageStore();
- txRepository = new TransactionRepository(persistenceManager, transactionIdManager);
+ txRepository = new TransactionRepository(persistenceManager, transactionIDManager);
// Start the wired components
- messageIdManager.start();
- channelIdManager.start();
- transactionIdManager.start();
+ messageIDManager.start();
+ channelIDManager.start();
+ transactionIDManager.start();
destinationJNDIMapper.start();
connFactoryJNDIMapper.start();
connectionManager.start();
@@ -268,12 +268,12 @@
// Stop the wired components
- messageIdManager.stop();
- messageIdManager = null;
- channelIdManager.stop();
- channelIdManager = null;
- transactionIdManager.stop();
- transactionIdManager = null;
+ messageIDManager.stop();
+ messageIDManager = null;
+ channelIDManager.stop();
+ channelIDManager = null;
+ transactionIDManager.stop();
+ transactionIDManager = null;
destinationJNDIMapper.stop();
destinationJNDIMapper = null;
connFactoryJNDIMapper.stop();
@@ -439,14 +439,14 @@
return securityStore.getDefaultSecurityConfig();
}
- public IdManager getMessageIdManager()
+ public IDManager getMessageIDManager()
{
- return messageIdManager;
+ return messageIDManager;
}
- public IdManager getChannelIdManager()
+ public IDManager getChannelIDManager()
{
- return channelIdManager;
+ return channelIDManager;
}
public ServerInvocationHandler getInvocationHandler()
Modified: trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -13,7 +13,7 @@
import org.jboss.jms.server.SecurityManager;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.util.ExceptionUtil;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
@@ -63,7 +63,7 @@
protected TransactionRepository tr;
- protected IdManager idm;
+ protected IDManager idm;
protected int nodeId;
@@ -102,7 +102,7 @@
tr = serverPeer.getTxRepository();
- idm = serverPeer.getChannelIdManager();
+ idm = serverPeer.getChannelIDManager();
nodeId = serverPeer.getServerPeerID();
Modified: trunk/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/destination/QueueService.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/destination/QueueService.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -111,7 +111,7 @@
if (postOffice.isLocal())
{
- queue = new PagingFilteredQueue(destination.getName(), idm.getId(), ms, pm, true, true,
+ queue = new PagingFilteredQueue(destination.getName(), idm.getID(), ms, pm, true, true,
executor, null,
destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
@@ -121,7 +121,7 @@
}
else
{
- queue = new LocalClusteredQueue(postOffice, nodeId, destination.getName(), idm.getId(), ms, pm, true, true,
+ queue = new LocalClusteredQueue(postOffice, nodeId, destination.getName(), idm.getID(), ms, pm, true, true,
executor, null, tr,
destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -23,7 +23,7 @@
import javax.jms.JMSException;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
/**
* Represents the set of methods from the ConnectionFactoryDelegate that are handled on the server.
@@ -44,6 +44,6 @@
byte[] getClientAOPConfig() throws JMSException;
- IdBlock getIdBlock(int size) throws JMSException;
+ IDBlock getIdBlock(int size) throws JMSException;
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -30,7 +30,7 @@
import org.jboss.jms.server.remoting.JMSDispatcher;
import org.jboss.jms.util.ExceptionUtil;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
/**
* Concrete implementation of ConnectionFactoryEndpoint
@@ -184,11 +184,11 @@
}
}
- public IdBlock getIdBlock(int size) throws JMSException
+ public IDBlock getIdBlock(int size) throws JMSException
{
try
{
- return serverPeer.getMessageIdManager().getIdBlock(size);
+ return serverPeer.getMessageIDManager().getIDBlock(size);
}
catch (Throwable t)
{
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -64,7 +64,7 @@
import org.jboss.messaging.core.DeliveryObserver;
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.local.PagingFilteredQueue;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -128,7 +128,7 @@
private MessageStore ms;
private DestinationManager dm;
- private IdManager idm;
+ private IDManager idm;
private QueuedExecutorPool pool;
private TransactionRepository tr;
private PostOffice postOffice;
@@ -157,7 +157,7 @@
ms = sp.getMessageStore();
dm = sp.getDestinationManager();
postOffice = sp.getPostOfficeInstance();
- idm = sp.getChannelIdManager();
+ idm = sp.getChannelIDManager();
pool = sp.getQueuedExecutorPool();
nodeId = sp.getServerPeerID();
tr = sp.getTxRepository();
@@ -248,7 +248,7 @@
ClientBrowserDelegate stub = new ClientBrowserDelegate(browserID);
- log.debug("created and registered " + ep);
+ log.debug(this + " created and registered " + ep);
return stub;
}
@@ -403,7 +403,7 @@
{
Cancel cancel = (Cancel)cancels.get(i);
- if (trace) { log.trace("Cancelling delivery " + cancel.getDeliveryId()); }
+ if (trace) { log.trace(this + " cancelling delivery " + cancel.getDeliveryId()); }
Delivery del = cancelDeliveryInternal(cancel);
@@ -422,7 +422,7 @@
public void recoverDeliveries(List deliveryRecoveryInfos) throws JMSException
{
- if (trace) { log.trace(this + "recoverDeliveries(): " + deliveryRecoveryInfos); }
+ if (trace) { log.trace(this + "recovering deliveries " + deliveryRecoveryInfos); }
try
{
if (postOffice.isLocal())
@@ -552,7 +552,7 @@
QueuedExecutor executor = (QueuedExecutor)pool.get();
PagingFilteredQueue q =
- new PagingFilteredQueue(dest.getName(), idm.getId(), ms, pm, true, false,
+ new PagingFilteredQueue(dest.getName(), idm.getID(), ms, pm, true, false,
executor, null, fullSize, pageSize, downCacheSize);
//Make a binding for this queue
@@ -778,13 +778,13 @@
Set channels = new HashSet();
- if (trace) { log.trace("Cancelling " + entries.size() + " deliveries"); }
+ if (trace) { log.trace(this + " cancelling " + entries.size() + " deliveries"); }
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry)iter.next();
- if (trace) { log.trace("Cancelling delivery with delivery id: " + entry.getKey()); }
+ if (trace) { log.trace(this + " cancelling delivery with delivery id: " + entry.getKey()); }
Delivery del = (Delivery)entry.getValue();
@@ -829,7 +829,7 @@
void acknowledgeTransactionally(List acks, Transaction tx) throws Throwable
{
- if (trace) { log.trace("Acknowledging transactionally " + acks.size() + " for tx: " + tx); }
+ if (trace) { log.trace(this + " acknowledging transactionally " + acks.size() + " for tx: " + tx); }
DeliveryCallback deliveryCallback = (DeliveryCallback)tx.getCallback(this);
@@ -888,7 +888,7 @@
private void acknowledgeDeliveryInternal(Ack ack) throws Throwable
{
- if (trace) { log.trace("Acknowledging delivery " + ack.getDeliveryId()); }
+ if (trace) { log.trace(this + " acknowledging delivery " + ack.getDeliveryId()); }
Delivery del = (Delivery)deliveries.remove(new Long(ack.getDeliveryId()));
@@ -953,51 +953,51 @@
return del;
}
-
+
private ConsumerDelegate failoverConsumer(JBossDestination jmsDestination,
- String selectorString,
- boolean noLocal, String subscriptionName,
- boolean connectionConsumer,
- long oldChannelID) throws Exception
+ String selectorString,
+ boolean noLocal, String subscriptionName,
+ boolean connectionConsumer,
+ long oldChannelID) throws Exception
{
- //fail over channel
+ // fail over channel
if (postOffice.isLocal())
{
throw new IllegalStateException("Cannot failover on a non clustered post office!");
}
+
+ log.debug(this + " failing over consumer");
- //this is a Clustered operation... so postOffice here must be Clustered
+ // this is a Clustered operation... so postOffice here must be Clustered
Binding binding = ((ClusteredPostOffice)postOffice).getBindingforChannelId(oldChannelID);
if (binding == null)
{
throw new IllegalStateException("Can't find failed over channel " + oldChannelID);
}
-
- // TODO - Remove this log.info before merging into trunk
- if (binding.getQueue() instanceof RemoteQueueStub)
+
+ if (trace)
{
- log.info("OldChannelId=" + oldChannelID + " while currentChannelId=" + ((RemoteQueueStub)binding.getQueue()).getChannelID());
+ long newChannelID =
+ binding.getQueue() instanceof RemoteQueueStub ?
+ ((RemoteQueueStub)binding.getQueue()).getChannelID() :
+ ((PagingFilteredQueue)binding.getQueue()).getChannelID();
+
+ log.trace(this + "failing over from channel " + oldChannelID + " to channel " + newChannelID);
}
- else
- {
- log.info("OldChannelId=" + oldChannelID + " while currentChannelId=" + ((PagingFilteredQueue)binding.getQueue()).getChannelID());
- }
-
+
int consumerID = connectionEndpoint.getServerPeer().getNextObjectID();
-
int prefetchSize = connectionEndpoint.getPrefetchSize();
ServerConsumerEndpoint ep =
-
new ServerConsumerEndpoint(consumerID, binding.getQueue(),
- binding.getQueue().getName(), this, selectorString, noLocal,
- jmsDestination, prefetchSize);
+ binding.getQueue().getName(), this, selectorString, noLocal,
+ jmsDestination, prefetchSize);
JMSDispatcher.instance.registerTarget(new Integer(consumerID), new ConsumerAdvised(ep));
-
+
ClientConsumerDelegate stub =
new ClientConsumerDelegate(consumerID, binding.getQueue().getChannelID(),
- prefetchSize, maxDeliveryAttempts);
+ prefetchSize, maxDeliveryAttempts);
synchronized (consumers)
{
@@ -1023,10 +1023,14 @@
selectorString = null;
}
- log.debug("creating consumer for " + jmsDestination + ", selector " + selectorString + ", " + (noLocal ? "noLocal, " : "") + "subscription " + subscriptionName);
+ log.debug(this + " creating consumer for " + jmsDestination +
+ (selectorString == null ? "" : ", selector '" + selectorString + "'") +
+ (subscriptionName == null ? "" : ", subscription '" + subscriptionName + "'") +
+ (noLocal ? ", noLocal" : ""));
+
+ ManagedDestination mDest = dm.
+ getDestination(jmsDestination.getName(), jmsDestination.isQueue());
- ManagedDestination mDest = dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue());
-
if (mDest == null)
{
throw new InvalidDestinationException("No such destination: " + jmsDestination);
@@ -1048,7 +1052,7 @@
Binding binding = null;
- //Always validate the selector first
+ // Always validate the selector first
Selector selector = null;
if (selectorString != null)
{
@@ -1062,7 +1066,7 @@
if (subscriptionName == null)
{
// non-durable subscription
- if (log.isTraceEnabled()) { log.trace("creating new non-durable subscription on " + jmsDestination); }
+ if (log.isTraceEnabled()) { log.trace(this + " creating new non-durable subscription on " + jmsDestination); }
// Create the non durable sub
QueuedExecutor executor = (QueuedExecutor)pool.get();
@@ -1071,7 +1075,7 @@
if (postOffice.isLocal())
{
- q = new PagingFilteredQueue(new GUID().toString(), idm.getId(), ms, pm, true, false,
+ q = new PagingFilteredQueue(new GUID().toString(), idm.getID(), ms, pm, true, false,
executor, selector,
mDest.getFullSize(),
mDest.getPageSize(),
@@ -1081,7 +1085,7 @@
}
else
{
- q = new LocalClusteredQueue(postOffice, nodeId, new GUID().toString(), idm.getId(), ms, pm, true, false,
+ q = new LocalClusteredQueue(postOffice, nodeId, new GUID().toString(), idm.getID(), ms, pm, true, false,
executor, selector, tr,
mDest.getFullSize(),
mDest.getPageSize(),
@@ -1106,7 +1110,7 @@
throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
}
- // we have a durable subscription, look it up
+ // We have a durable subscription, look it up
String clientID = connectionEndpoint.getClientID();
if (clientID == null)
{
@@ -1123,28 +1127,29 @@
{
// Does not already exist
- if (trace) { log.trace("creating new durable subscription on " + jmsDestination); }
+ if (trace) { log.trace(this + " creating new durable subscription on " + jmsDestination); }
QueuedExecutor executor = (QueuedExecutor)pool.get();
PagingFilteredQueue q;
-
+
if (postOffice.isLocal())
{
- q = new PagingFilteredQueue(name, idm.getId(), ms, pm, true, true,
- executor, selector,
- mDest.getFullSize(),
- mDest.getPageSize(),
- mDest.getDownCacheSize());
-
+ q = new PagingFilteredQueue(name, idm.getID(), ms, pm, true, true,
+ executor, selector,
+ mDest.getFullSize(),
+ mDest.getPageSize(),
+ mDest.getDownCacheSize());
+
binding = postOffice.bindQueue(topicCond, q);
}
else
{
- q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getId(), ms, pm, true, true,
- executor, selector, tr,
- mDest.getFullSize(),
- mDest.getPageSize(),
- mDest.getDownCacheSize());
+ q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getID(),
+ ms, pm, true, true,
+ executor, selector, tr,
+ mDest.getFullSize(),
+ mDest.getPageSize(),
+ mDest.getDownCacheSize());
ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
@@ -1162,7 +1167,7 @@
{
//Durable sub already exists
- if (trace) { log.trace("subscription " + subscriptionName + " already exists"); }
+ if (trace) { log.trace(this + " subscription " + subscriptionName + " already exists"); }
// From javax.jms.Session Javadoc (and also JMS 1.1 6.11.1):
// A client can change an existing durable subscription by creating a durable
@@ -1210,7 +1215,7 @@
if (postOffice.isLocal())
{
- q = new PagingFilteredQueue(name, idm.getId(), ms, pm, true, true,
+ q = new PagingFilteredQueue(name, idm.getID(), ms, pm, true, true,
executor, selector,
mDest.getFullSize(),
mDest.getPageSize(),
@@ -1219,7 +1224,7 @@
}
else
{
- q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getId(), ms, pm, true, true,
+ q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getID(), ms, pm, true, true,
executor, selector, tr,
mDest.getFullSize(),
mDest.getPageSize(),
@@ -1271,7 +1276,7 @@
consumers.put(new Integer(consumerID), ep);
}
- log.debug("created and registered " + ep);
+ log.debug(this + " created and registered " + ep);
return stub;
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -24,7 +24,7 @@
import javax.jms.JMSException;
import org.jboss.jms.server.endpoint.ConnectionFactoryEndpoint;
import org.jboss.jms.server.endpoint.CreateConnectionResult;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
/**
*
@@ -70,7 +70,7 @@
return endpoint.getClientAOPConfig();
}
- public IdBlock getIdBlock(int size) throws JMSException
+ public IDBlock getIdBlock(int size) throws JMSException
{
return endpoint.getIdBlock(size);
}
Modified: trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -51,7 +51,7 @@
import org.jboss.jms.tx.TransactionRequest;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.message.MessageFactory;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvocationResponse;
import org.jboss.remoting.callback.Callback;
@@ -442,12 +442,12 @@
if (trace) { log.trace("wrote null response"); }
}
- else if (res instanceof IdBlock)
+ else if (res instanceof IDBlock)
{
//Return value from getMessageNow
dos.write(ID_BLOCK_RESPONSE);
- IdBlock block = (IdBlock)res;
+ IDBlock block = (IDBlock)res;
block.write(dos);
@@ -822,7 +822,7 @@
}
case ID_BLOCK_RESPONSE:
{
- IdBlock block = new IdBlock();
+ IDBlock block = new IDBlock();
block.read(dis);
Modified: trunk/src/main/org/jboss/jms/util/MessageQueueNameHelper.java
===================================================================
--- trunk/src/main/org/jboss/jms/util/MessageQueueNameHelper.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/jms/util/MessageQueueNameHelper.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -94,17 +94,17 @@
return new MessageQueueNameHelper(messageQueueName);
}
- public static String createSubscriptionName(String clientId, String subName)
+ public static String createSubscriptionName(String clientID, String subName)
{
- if (clientId == null)
+ if (clientID == null)
{
- throw new IllegalArgumentException("clientId name is null");
+ throw new IllegalArgumentException("clientID name is null");
}
if (subName == null)
{
throw new IllegalArgumentException("Subscription name is null");
}
- return clientId + SEPARATOR + subName;
+ return clientID + SEPARATOR + subName;
}
}
Modified: trunk/src/main/org/jboss/messaging/core/Channel.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/Channel.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/Channel.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -71,8 +71,6 @@
* A recoverable channel must always accept reliable messages, so this method must always return
* true for a recoverable channel.
*
- * @see State#acceptReliableMessages()
- *
* @return false if the channel doesn't accept reliable messages.
*/
public boolean acceptReliableMessages();
Modified: trunk/src/main/org/jboss/messaging/core/plugin/IdBlock.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/IdBlock.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/IdBlock.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -28,27 +28,25 @@
/**
*
- * A IdBlock.
+ * A IDBlock.
*
* @author <a href="tim.fox at jboss.com">Tim Fox</a>
* @version 1.1
*
- * IdBlock.java,v 1.1 2006/03/07 17:11:15 timfox Exp
+ * IDBlock.java,v 1.1 2006/03/07 17:11:15 timfox Exp
*/
-public class IdBlock implements Streamable
+public class IDBlock implements Streamable
{
- protected long low;
+ private long low;
+ private long high;
- protected long high;
-
- public IdBlock()
+ public IDBlock()
{
}
- public IdBlock(long low, long high)
+ public IDBlock(long low, long high)
{
this.low = low;
-
this.high = high;
}
@@ -65,20 +63,18 @@
public void read(DataInputStream in) throws Exception
{
low = in.readLong();
-
high = in.readLong();
}
public void write(DataOutputStream out) throws Exception
{
out.writeLong(low);
-
out.writeLong(high);
}
public String toString()
{
- return "IdBlock[" + low + "-" + high + "]";
+ return "IDBlock[" + low + "-" + high + "]";
}
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/IdManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/IdManager.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/IdManager.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -27,92 +27,112 @@
/**
*
- * A IdManager.
+ * A IDManager.
*
* @author <a href="tim.fox at jboss.com">Tim Fox</a>
+ * @author <a href="ovidiu at jboss.org">Ovidiu Feodorov</a>
* @version 1.1
*
- * IdManager.java,v 1.1 2006/03/07 17:11:15 timfox Exp
+ * IDManager.java,v 1.1 2006/03/07 17:11:15 timfox Exp
*/
-public class IdManager implements MessagingComponent
+public class IDManager implements MessagingComponent
{
- private static final Logger log = Logger.getLogger(IdManager.class);
-
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(IDManager.class);
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
private boolean trace = log.isTraceEnabled();
-
- protected int bigBlockSize;
-
- protected long high;
-
- protected long nextBlock;
-
- protected PersistenceManager pm;
-
- protected String counterName;
-
+
private boolean started;
-
- public IdManager(String counterName, int bigBlockSize, PersistenceManager pm) throws Exception
+
+ private String counterName;
+
+ private int bigBlockSize;
+ private long high;
+ private long low;
+
+ private PersistenceManager pm;
+
+ // Constructors --------------------------------------------------
+
+ public IDManager(String counterName, int bigBlockSize, PersistenceManager pm) throws Exception
{
+ this.counterName = counterName;
this.bigBlockSize = bigBlockSize;
-
this.pm = pm;
-
- this.counterName = counterName;
}
-
+
+ // MessagingComponent implementation -----------------------------
+
public synchronized void start() throws Exception
{
getNextBigBlock();
-
started = true;
}
-
+
public synchronized void stop() throws Exception
{
started = false;
}
-
- public synchronized IdBlock getIdBlock(int size) throws Exception
+
+ // Public --------------------------------------------------------
+
+ protected void getNextBigBlock() throws Exception
{
+ low = pm.reserveIDBlock(counterName, bigBlockSize);
+ high = low + bigBlockSize - 1;
+ if (trace) { log.trace(this + " retrieved next block of size " + bigBlockSize + " from PersistenceManager, starting at " + low); }
+ }
+
+ public synchronized IDBlock getIDBlock(int size) throws Exception
+ {
if (!started)
{
throw new IllegalStateException(this + " is not started");
}
-
+
if (size <= 0)
{
throw new IllegalArgumentException("block size must be > 0");
}
-
+
if (size > bigBlockSize)
{
throw new IllegalArgumentException("block size must be <= bigBlockSize");
}
-
- if (size > high - nextBlock + 1)
+
+ if (size > high - low + 1)
{
getNextBigBlock();
}
-
- long low = nextBlock;
-
- nextBlock += size;
-
- return new IdBlock(low, nextBlock - 1);
+
+ long low = this.low;
+
+ this.low += size;
+
+ return new IDBlock(low, this.low - 1);
}
-
- public synchronized long getId() throws Exception
+
+ public synchronized long getID() throws Exception
{
- return getIdBlock(1).low;
+ return getIDBlock(1).getLow();
}
-
- protected void getNextBigBlock() throws Exception
+
+ public String toString()
{
- nextBlock = pm.reserveIDBlock(counterName, bigBlockSize);
-
- if (trace) { log.trace("Retrieved next block of size " + bigBlockSize + " from pm starting at " + nextBlock); }
-
- high = nextBlock + bigBlockSize - 1;
+ return "IDManager[" + counterName + ", " + low + "-" + high + "]";
}
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -162,9 +162,9 @@
public long reserveIDBlock(String counterName, int size) throws Exception
{
- //TODO This will need locking (e.g. SELECT ... FOR UPDATE...) in the clustered case
+ // TODO This will need locking (e.g. SELECT ... FOR UPDATE...) in the clustered case
- if (trace) { log.trace("Getting id block for counter: " + counterName + " ,size: " + size); }
+ if (trace) { log.trace("Getting ID block for counter " + counterName + ", size " + size); }
if (size <= 0)
{
@@ -179,14 +179,13 @@
try
{
conn = ds.getConnection();
-
+
String selectCounterSQL = getSQLStatement("SELECT_COUNTER");
ps = conn.prepareStatement(selectCounterSQL);
ps.setString(1, counterName);
- if (trace) { log.trace("selecting counter: " + selectCounterSQL); }
rs = ps.executeQuery();
if (trace) { log.trace(JDBCUtil.statementToString(selectCounterSQL, counterName)); }
@@ -202,17 +201,13 @@
ps = conn.prepareStatement(insertCounterSQL);
ps.setString(1, counterName);
-
ps.setLong(2, size);
- if (trace) { log.trace("inserting counter: " + insertCounterSQL); }
- int rows = ps.executeUpdate();
- if (trace) { log.trace(JDBCUtil.statementToString(insertCounterSQL, counterName)
- + " inserted " + rows + " rows"); }
+ int rows = ps.executeUpdate();
+ if (trace) { log.trace(JDBCUtil.statementToString(insertCounterSQL, counterName, new Integer(size)) + " inserted " + rows + " rows"); }
ps.close();
ps = null;
-
return 0;
}
@@ -228,13 +223,10 @@
ps = conn.prepareStatement(updateCounterSQL);
ps.setLong(1, nextId + size);
-
ps.setString(2, counterName);
- if (trace) { log.trace("updating counter: " + updateCounterSQL); }
- int rows = ps.executeUpdate();
- if (trace) { log.trace(JDBCUtil.statementToString(updateCounterSQL, new Long(nextId + size),
- counterName) + " updated " + rows + " rows"); }
+ int rows = ps.executeUpdate();
+ if (trace) { log.trace(JDBCUtil.statementToString(updateCounterSQL, new Long(nextId + size), counterName) + " updated " + rows + " rows"); }
return nextId;
}
@@ -357,9 +349,7 @@
HashMap coreHeaders = bytesToMap(bytes);
byte[] payload = getBytes(rs, 7);
- //TODO we don't need this
- int persistentChannelCount = rs.getInt(8);
-
+
//TODO - We are mixing concerns here
//The basic JDBCPersistencManager should *only* know about core messages - not
//JBossMessages - we should subclass JBDCPersistenceManager and the JBossMessage
@@ -1426,7 +1416,9 @@
psReference.setLong(3, ref.getMessageID());
- int rows = psReference.executeUpdate();
+ int rows = psReference.executeUpdate();
+
+ if (trace) { log.trace("Updated " + rows + " rows"); }
}
catch (Exception e)
{
@@ -1745,9 +1737,9 @@
return callback;
}
- /*
- * We order the list of references in ascending message order
- * thus preventing deadlock when 2 or more channels are updating the same messages in different transactions.
+ /**
+ * We order the list of references in ascending message order thus preventing deadlock when 2 or
+ * more channels are updating the same messages in different transactions.
*/
protected void orderReferences(List references)
{
@@ -1758,29 +1750,28 @@
throws Exception
{
//TODO - A slight optimisation - it's possible we have refs referring to the same message
- //so we will end up acquiring the lock more than once which is unnecessary
- //If find unique set of messages can avoid this
+ // so we will end up acquiring the lock more than once which is unnecessary. If find
+ // unique set of messages can avoid this.
+
List allRefs = new ArrayList(refsToAdd.size() + refsToRemove.size());
- Iterator iter = refsToAdd.iterator();
- while (iter.hasNext())
+
+ for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
{
- ChannelRefPair pair = (ChannelRefPair)iter.next();
+ ChannelRefPair pair = (ChannelRefPair)i.next();
allRefs.add(pair.ref);
}
- iter = refsToRemove.iterator();
- while (iter.hasNext())
+
+ for(Iterator i = refsToRemove.iterator(); i.hasNext(); )
{
- ChannelRefPair pair = (ChannelRefPair)iter.next();
+ ChannelRefPair pair = (ChannelRefPair)i.next();
allRefs.add(pair.ref);
}
orderReferences(allRefs);
- //For one phase we simply add rows corresponding to the refs
- //and remove rows corresponding to the deliveries in one jdbc tx
- //We also need to store or remove messages as necessary, depending
- //on whether they've already been stored or still referenced by other
- //channels
+ // For one phase we simply add rows corresponding to the refs and remove rows corresponding to
+ // the deliveries in one jdbc tx. We also need to store or remove messages as necessary,
+ // depending on whether they've already been stored or still referenced by other channels.
Connection conn = null;
PreparedStatement psReference = null;
@@ -1794,29 +1785,25 @@
{
conn = ds.getConnection();
- //obtain locks on all messages
+ // Obtain locks on all messages
getLocks(allRefs);
- //First the adds
-
- iter = refsToAdd.iterator();
-
- boolean batch = usingBatchUpdates && refsToAdd.size() > 0;
-
+ // First the adds
+
boolean messageInsertsInBatch = false;
boolean messageUpdatesInBatch = false;
-
+ boolean batch = usingBatchUpdates && refsToAdd.size() > 0;
+
if (batch)
{
psReference = conn.prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
psInsertMessage = conn.prepareStatement(getSQLStatement("INSERT_MESSAGE"));
psIncMessage = conn.prepareStatement(getSQLStatement("INC_CHANNELCOUNT"));
}
-
- while (iter.hasNext())
+
+ for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
{
- ChannelRefPair pair = (ChannelRefPair) iter.next();
-
+ ChannelRefPair pair = (ChannelRefPair)i.next();
MessageReference ref = pair.ref;
if (!batch)
@@ -1824,8 +1811,8 @@
psReference = conn.prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
}
- //Now store the reference
- addReference(pair.channelId, ref, psReference, false);
+ // Now store the reference
+ addReference(pair.channelID, ref, psReference, false);
if (batch)
{
@@ -1852,18 +1839,15 @@
boolean added;
if (!m.isPersisted())
{
- //First time so add message
+ // First time so add message
storeMessage(m, psInsertMessage);
-
added = true;
-
m.setPersisted(true);
}
else
{
- //Update message channel count
+ // Update message channel count
incrementChannelCount(m, psIncMessage);
-
added = false;
}
@@ -1872,13 +1856,11 @@
if (added)
{
psInsertMessage.addBatch();
-
messageInsertsInBatch = true;
}
else
{
psIncMessage.addBatch();
-
messageUpdatesInBatch = true;
}
}
@@ -1887,13 +1869,11 @@
if (added)
{
int rows = psInsertMessage.executeUpdate();
-
if (trace) { log.trace("Inserted " + rows + " rows"); }
}
else
{
int rows = psIncMessage.executeUpdate();
-
if (trace) { log.trace("Updated " + rows + " rows"); }
}
psInsertMessage.close();
@@ -1905,6 +1885,10 @@
if (batch)
{
+ // Process the add batch
+
+
+
int[] rowsReference = psReference.executeBatch();
if (trace) { logBatchUpdate(getSQLStatement("INSERT_MESSAGE_REF"), rowsReference, "inserted"); }
@@ -1912,13 +1896,12 @@
if (messageInsertsInBatch)
{
int[] rowsMessage = psInsertMessage.executeBatch();
-
if (trace) { logBatchUpdate(getSQLStatement("INSERT_MESSAGE"), rowsMessage, "inserted"); }
}
+
if (messageUpdatesInBatch)
{
int[] rowsMessage = psIncMessage.executeBatch();
-
if (trace) { logBatchUpdate(getSQLStatement("INC_CHANNELCOUNT"), rowsMessage, "updated"); }
}
@@ -1930,32 +1913,30 @@
psIncMessage = null;
}
- //Now the removes
-
- iter = refsToRemove.iterator();
-
- batch = usingBatchUpdates && refsToRemove.size() > 0;
+ // Now the removes
psReference = null;
psDeleteMessage = null;
-
+ batch = usingBatchUpdates && refsToRemove.size() > 0;
+
if (batch)
{
psReference = conn.prepareStatement(getSQLStatement("DELETE_MESSAGE_REF"));
psDeleteMessage = conn.prepareStatement(getSQLStatement("DELETE_MESSAGE"));
psDecMessage = conn.prepareStatement(getSQLStatement("DEC_CHANNELCOUNT"));
}
+
- while (iter.hasNext())
+ for(Iterator i = refsToRemove.iterator(); i.hasNext(); )
{
- ChannelRefPair pair = (ChannelRefPair) iter.next();
+ ChannelRefPair pair = (ChannelRefPair)i.next();
if (!batch)
{
psReference = conn.prepareStatement(getSQLStatement("DELETE_MESSAGE_REF"));
}
- removeReference(pair.channelId, pair.ref, psReference);
+ removeReference(pair.channelID, pair.ref, psReference);
if (batch)
{
@@ -1964,9 +1945,7 @@
else
{
int rows = psReference.executeUpdate();
-
if (trace) { log.trace("Deleted " + rows + " rows"); }
-
psReference.close();
psReference = null;
}
@@ -1979,28 +1958,25 @@
Message m = pair.ref.getMessage();
- //Update the channel count
+ // Update the channel count
decrementChannelCount(m, psDecMessage);
- //Delete the message (if necessary)
+ // Delete the message (if necessary)
removeMessage(m, psDeleteMessage);
if (batch)
{
psDecMessage.addBatch();
-
- psDeleteMessage.addBatch();
+ psDeleteMessage.addBatch();
}
else
{
int rows = psDecMessage.executeUpdate();
-
if (trace) { log.trace("Updated " + rows + " rows"); }
rows = psDeleteMessage.executeUpdate();
-
if (trace) { log.trace("Deleted " + rows + " rows"); }
psDeleteMessage.close();
@@ -2012,6 +1988,8 @@
if (batch)
{
+ // Process the remove batch
+
int[] rows = psReference.executeBatch();
if (trace) { logBatchUpdate(getSQLStatement("DELETE_MESSAGE_REF"), rows, "deleted"); }
@@ -2035,7 +2013,6 @@
catch (Exception e)
{
wrap.exceptionOccurred();
-
throw e;
}
finally
@@ -2327,7 +2304,7 @@
psReference = conn.prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
}
- prepareToAddReference(pair.channelId, pair.ref, tx, psReference);
+ prepareToAddReference(pair.channelID, pair.ref, tx, psReference);
if (batch)
{
@@ -2450,7 +2427,7 @@
psReference = conn.prepareStatement(getSQLStatement("UPDATE_MESSAGE_REF"));
}
- prepareToRemoveReference(pair.channelId, pair.ref, tx, psReference);
+ prepareToRemoveReference(pair.channelID, pair.ref, tx, psReference);
if (batch)
{
@@ -2771,14 +2748,10 @@
}
}
-
-
- protected void addReference(long channelID, MessageReference ref, PreparedStatement ps, boolean paged) throws Exception
+ protected void addReference(long channelID, MessageReference ref,
+ PreparedStatement ps, boolean paged) throws Exception
{
- if (trace)
- {
- log.trace("adding " + ref + " to channel " + channelID);
- }
+ if (trace) { log.trace("adding " + ref + " to channel " + channelID); }
ps.setLong(1, channelID);
ps.setLong(2, ref.getMessageID());
@@ -2797,12 +2770,10 @@
ps.setString(8, ref.isReliable() ? "Y" : "N");
}
- protected void removeReference(long channelID, MessageReference ref, PreparedStatement ps) throws Exception
+ protected void removeReference(long channelID, MessageReference ref, PreparedStatement ps)
+ throws Exception
{
- if (trace)
- {
- log.trace("removing " + ref + " from channel " + channelID);
- }
+ if (trace) { log.trace("removing " + ref + " from channel " + channelID); }
ps.setLong(1, ref.getMessageID());
ps.setLong(2, channelID);
@@ -2811,11 +2782,7 @@
protected void prepareToAddReference(long channelID, MessageReference ref, Transaction tx, PreparedStatement ps)
throws Exception
{
- if (trace)
- {
- log.trace("adding " + ref + " to channel " + channelID
- + (tx == null ? " non-transactionally" : " on transaction: " + tx));
- }
+ if (trace) { log.trace("adding " + ref + " to channel " + channelID + (tx == null ? " non-transactionally" : " on transaction: " + tx)); }
ps.setLong(1, channelID);
ps.setLong(2, ref.getMessageID());
@@ -3356,14 +3323,12 @@
private static class ChannelRefPair
{
- private long channelId;
-
+ private long channelID;
private MessageReference ref;
- private ChannelRefPair(long channelId, MessageReference ref)
+ private ChannelRefPair(long channelID, MessageReference ref)
{
- this.channelId = channelId;
-
+ this.channelID = channelID;
this.ref = ref;
}
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBindings.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBindings.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBindings.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -37,15 +37,24 @@
*/
public class DefaultBindings implements Bindings
{
+ // Constants -----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
private List bindings;
-
private int durableCount;
-
+
+ // Constructors --------------------------------------------------
+
public DefaultBindings()
{
bindings = new ArrayList();
}
+ // Bindings implementation ---------------------------------------
+
public void addBinding(Binding binding)
{
if (bindings.contains(binding))
@@ -53,38 +62,55 @@
throw new IllegalArgumentException("Bindings already contains binding: " + binding);
}
bindings.add(binding);
-
+
if (binding.getQueue().isRecoverable())
{
durableCount++;
}
}
- public Collection getAllBindings()
- {
- return bindings;
- }
-
public boolean removeBinding(Binding binding)
{
boolean removed = bindings.remove(binding);
-
+
if (removed && binding.getQueue().isRecoverable())
{
durableCount--;
}
-
+
return removed;
}
-
+
+ public Collection getAllBindings()
+ {
+ return bindings;
+ }
+
public int getDurableCount()
{
return durableCount;
}
-
+
public boolean isEmpty()
{
return bindings.isEmpty();
}
+ // Public --------------------------------------------------------
+
+ public String toString()
+ {
+ return "Bindings[" + Integer.toHexString(hashCode()) + ", count=" + bindings.size() + "]";
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+
+
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredBindings.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredBindings.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredBindings.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -41,67 +41,93 @@
*/
class DefaultClusteredBindings extends DefaultBindings implements ClusteredBindings
{
+
+ // Constants -----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
// Map <name, router>
private Map nameMap;
-
private int thisNode;
-
private int localDurableCount;
-
+
+ // Constructors --------------------------------------------------
+
DefaultClusteredBindings(int thisNode)
{
super();
-
+
nameMap = new HashMap();
-
+
this.thisNode = thisNode;
}
-
+
+ // DefaultBindings overrides -------------------------------------
+
public void addBinding(Binding binding)
{
super.addBinding(binding);
-
+
if (binding.getNodeID() == thisNode && binding.getQueue().isRecoverable())
{
localDurableCount++;
- }
+ }
}
-
+
public boolean removeBinding(Binding binding)
{
boolean removed = super.removeBinding(binding);
-
+
if (!removed)
{
return false;
}
-
+
if (binding.getNodeID() == thisNode && binding.getQueue().isRecoverable())
{
localDurableCount--;
- }
+ }
return true;
}
-
+
+ // ClusteredBindings implementation ------------------------------
+
+ public Collection getRouters()
+ {
+ return nameMap.values();
+ }
+
public int getLocalDurableCount()
{
return localDurableCount;
}
-
- public Collection getRouters()
- {
- return nameMap.values();
- }
-
+
public void addRouter(String queueName, ClusterRouter router)
{
nameMap.put(queueName, router);
}
-
+
public void removeRouter(String queueName)
{
nameMap.remove(queueName);
}
+ // Public --------------------------------------------------------
+
+ public String toString()
+ {
+ return "CusteredBindings[" + super.toString() + " count=" + nameMap.size() + "]";
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -801,10 +801,9 @@
*/
public void asyncSendRequest(ClusterRequest request) throws Exception
{
- if (trace) { log.trace(this.currentNodeId + " sending asynch request to group, request: " + request); }
+ if (trace) { log.trace(this + " sending asynchronously " + request + " to group"); }
byte[] bytes = writeRequest(request);
-
asyncChannel.send(new Message(null, null, bytes));
}
@@ -813,22 +812,17 @@
*/
public void asyncSendRequest(ClusterRequest request, int nodeId) throws Exception
{
- if (trace) { log.trace(this.currentNodeId + " sending asynch request to single node, request: " + request + " node " + nodeId); }
-
Address address = this.getAddressForNodeId(nodeId, false);
- if (trace) { log.trace(this.currentNodeId + " sending to address " + address); }
-
if (address == null)
{
throw new IllegalArgumentException("Cannot find address for node " + nodeId);
}
- byte[] bytes = writeRequest(request);
+ if (trace) { log.trace(this + " sending asynchronously " + request + " to node " + nodeId + "/" + address); }
- Message m = new Message(address, null, bytes);
-
- asyncChannel.send(m);
+ byte[] bytes = writeRequest(request);
+ asyncChannel.send(new Message(address, null, bytes));
}
/*
@@ -840,13 +834,13 @@
{
holdingArea.put(id, tx);
- if (trace) { log.trace(this.currentNodeId + " added transaction " + tx + " to holding area with id " + id); }
+ if (trace) { log.trace(this + " added transaction " + tx + " to holding area as " + id); }
}
}
public void commitTransaction(TransactionId id) throws Throwable
{
- if (trace) { log.trace(this.currentNodeId + " committing transaction " + id ); }
+ if (trace) { log.trace(currentNodeId + " committing transaction " + id ); }
ClusterTransaction tx = null;
@@ -862,12 +856,12 @@
tx.commit(this);
- if (trace) { log.trace(this.currentNodeId + " committed transaction " + id ); }
+ if (trace) { log.trace(this + " committed transaction " + id ); }
}
public void rollbackTransaction(TransactionId id) throws Throwable
{
- if (trace) { log.trace(this.currentNodeId + " rolling back transaction " + id ); }
+ if (trace) { log.trace(this + " rolling back transaction " + id ); }
ClusterTransaction tx = null;
@@ -883,14 +877,14 @@
tx.rollback(this);
- if (trace) { log.trace(this.currentNodeId + " committed transaction " + id ); }
+ if (trace) { log.trace(this + " committed transaction " + id ); }
}
public void updateQueueStats(int nodeId, List statsList) throws Exception
{
lock.readLock().acquire();
- if (trace) { log.trace(this.currentNodeId + " updating queue stats from node " + nodeId + " stats size: " + statsList.size()); }
+ if (trace) { log.trace(this + " updating queue stats from node " + nodeId + " stats size: " + statsList.size()); }
try
{
@@ -905,7 +899,7 @@
if (nameMap == null)
{
//This is ok, the node might have left
- if (trace) { log.trace(this.currentNodeId + " cannot find node in name map, i guess the node might have left?"); }
+ if (trace) { log.trace(this + " cannot find node in name map, i guess the node might have left?"); }
}
else
{
@@ -920,7 +914,7 @@
if (bb == null)
{
//I guess this is possible if the queue was unbound
- if (trace) { log.trace(this.currentNodeId + " cannot find binding for queue " + st.getQueueName() + " it could have been unbound"); }
+ if (trace) { log.trace(this + " cannot find binding for queue " + st.getQueueName() + " it could have been unbound"); }
}
else
{
@@ -952,7 +946,7 @@
localQueue.deliver(false);
- if (trace) { log.trace(this.currentNodeId + " triggered delivery for " + localQueue.getName()); }
+ if (trace) { log.trace(this + " triggered delivery for " + localQueue.getName()); }
}
}
}
@@ -1177,10 +1171,9 @@
{
ClusteredBindings cb = (ClusteredBindings)conditionMap.get(condition);
+ int lastNodeId = -1;
boolean startInternalTx = false;
- int lastNodeId = -1;
-
if (cb != null)
{
if (trace) { log.trace(this + " found clustered bindings " + cb); }
@@ -1208,18 +1201,12 @@
}
int numberRemote = 0;
-
+ long lastChannelId = -1;
Map queueNameNodeIdMap = null;
- long lastChannelId = -1;
-
- Collection routers = cb.getRouters();
-
- Iterator iter = routers.iterator();
-
- while (iter.hasNext())
+ for(Iterator i = cb.getRouters().iterator(); i.hasNext(); )
{
- ClusterRouter router = (ClusterRouter)iter.next();
+ ClusterRouter router = (ClusterRouter)i.next();
Delivery del = router.handle(null, ref, tx);
@@ -1229,7 +1216,7 @@
ClusteredQueue queue = (ClusteredQueue)del.getObserver();
- if (trace) { log.trace(this + " successfully routed message to " + (queue.isLocal() ? "local" : "remote")+ " destination '" + queue.getName() + "' on node " + queue.getNodeId()); }
+ if (trace) { log.trace(this + " successfully routed message to " + (queue.isLocal() ? "LOCAL" : "REMOTE") + " destination '" + queue.getName() + "' on node " + queue.getNodeId()); }
if (router.numberOfReceivers() > 1)
{
@@ -1247,9 +1234,9 @@
if (!queue.isLocal())
{
- // We need to send the message remotely
+ // We need to send the message remotely, count recipients so we know whether
+ // to unicast or multicast
numberRemote++;
-
lastNodeId = queue.getNodeId();
lastChannelId = queue.getChannelID();
}
@@ -1318,8 +1305,9 @@
if (startInternalTx)
{
+ if (trace) { log.trace(this + " committing " + tx); }
tx.commit();
- if (trace) { log.trace(this + " committed internal transaction"); }
+ if (trace) { log.trace(this + " committed " + tx); }
}
}
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultRouter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultRouter.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultRouter.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -269,7 +269,7 @@
public String toString()
{
- return "DefaultRouter[" + Integer.toHexString(hashCode()) + "]";
+ return "Router[" + Integer.toHexString(hashCode()) + "]";
}
// Package protected ---------------------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/LocalClusteredQueue.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/LocalClusteredQueue.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/LocalClusteredQueue.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -59,33 +59,30 @@
private TransactionRepository tr;
//TODO - we shouldn't have to specify office AND nodeId
- public LocalClusteredQueue(PostOffice office, int nodeId, String name, long id, MessageStore ms, PersistenceManager pm,
- boolean acceptReliableMessages, boolean recoverable, QueuedExecutor executor,
- Filter filter, TransactionRepository tr,
+ public LocalClusteredQueue(PostOffice office, int nodeId, String name, long id,
+ MessageStore ms, PersistenceManager pm,
+ boolean acceptReliableMessages, boolean recoverable,
+ QueuedExecutor executor, Filter filter, TransactionRepository tr,
int fullSize, int pageSize, int downCacheSize)
{
- super(name, id, ms, pm, acceptReliableMessages, recoverable, executor, filter, fullSize, pageSize, downCacheSize);
+ super(name, id, ms, pm, acceptReliableMessages, recoverable,
+ executor, filter, fullSize, pageSize, downCacheSize);
this.nodeId = nodeId;
-
this.tr = tr;
-
- //TODO - This cast is potentially unsafe - handle better
- this.office = (PostOfficeInternal)office;
+ this.office = (PostOfficeInternal)office; //TODO - This cast is potentially unsafe - handle better
}
- public LocalClusteredQueue(PostOffice office, int nodeId, String name, long id, MessageStore ms, PersistenceManager pm,
- boolean acceptReliableMessages, boolean recoverable, QueuedExecutor executor,
- Filter filter, TransactionRepository tr)
+ public LocalClusteredQueue(PostOffice office, int nodeId, String name, long id,
+ MessageStore ms, PersistenceManager pm,
+ boolean acceptReliableMessages, boolean recoverable,
+ QueuedExecutor executor, Filter filter, TransactionRepository tr)
{
super(name, id, ms, pm, acceptReliableMessages, recoverable, executor, filter);
this.nodeId = nodeId;
-
this.tr = tr;
-
- //TODO - This cast is potentially unsafe - handle better
- this.office = (PostOfficeInternal)office;
+ this.office = (PostOfficeInternal)office; //TODO - This cast is potentially unsafe - handle better
}
public void setPullQueue(RemoteQueueStub queue)
@@ -135,7 +132,7 @@
public String toString()
{
- return "LocalClusteredQueue[" + this.getChannelID() + "/" + this.getName() +"]";
+ return "LocalClusteredQueue[" + getChannelID() + "/" + getName() +"]";
}
/*
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/RemoteQueueStub.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/RemoteQueueStub.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/RemoteQueueStub.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -49,78 +49,57 @@
*/
public class RemoteQueueStub implements ClusteredQueue
{
+ // Constants -----------------------------------------------------
+
private static final Logger log = Logger.getLogger(RemoteQueueStub.class);
-
- private int nodeId;
-
+
+ // Static --------------------------------------------------------
+
+ private static boolean trace = log.isTraceEnabled();
+
+ // Attributes ----------------------------------------------------
+
+ private int nodeID;
private String name;
-
- private long id;
-
+ private long channelID;
private Filter filter;
-
private boolean recoverable;
-
private PersistenceManager pm;
-
private QueueStats stats;
-
+
+ // Constructors --------------------------------------------------
+
public RemoteQueueStub(int nodeId, String name, long id, boolean recoverable,
PersistenceManager pm, Filter filter)
{
- this.nodeId = nodeId;
-
+ this.nodeID = nodeId;
this.name = name;
-
- this.id = id;
-
+ this.channelID = id;
this.recoverable = recoverable;
-
this.pm = pm;
-
this.filter = filter;
}
-
- public int getNodeId()
- {
- return nodeId;
- }
-
- public boolean isLocal()
- {
- return false;
- }
-
- public void setStats(QueueStats stats)
- {
- this.stats = stats;
- }
-
- public QueueStats getStats()
- {
- return stats;
- }
-
+
+ // Receiver implementation ---------------------------------------
+
public Delivery handle(DeliveryObserver observer, MessageReference reference, Transaction tx)
{
+ if (trace) { log.trace(this + " handling " + reference); }
+
if (filter != null && !filter.accept(reference))
{
- Delivery del = new SimpleDelivery(this, reference, false, false);
-
- log.info("********** doesn't match filter");
-
- return del;
+ if (trace) { log.trace(this + " rejecting " + reference + " because it doesn't match filter"); }
+ return new SimpleDelivery(this, reference, false, false);
}
-
+
if (recoverable && reference.isReliable())
{
try
{
- //If the message is persistent and we are recoverable then we persist here, *before*
- //the message is sent across the network
-
- //This will increment any channelcount on the message in storage
- pm.addReference(id, reference, tx);
+ // If the message is persistent and we are recoverable then we persist here, *before*
+ // the message is sent across the network. This will increment any channelcount on the
+ // message in storage.
+ pm.addReference(channelID, reference, tx);
}
catch (Exception e)
{
@@ -128,59 +107,59 @@
return null;
}
}
-
- log.info("*********** accepting message:" + reference);
-
- return new SimpleDelivery(this, reference, false);
- }
- public Filter getFilter()
- {
- return filter;
+ if (trace) { log.trace(this + " accepting " + reference + " for delivery"); }
+ return new SimpleDelivery(this, reference, false);
}
- public String getName()
- {
- return name;
- }
+ // Distributor implementation ------------------------------------
- public boolean acceptReliableMessages()
+ public boolean contains(Receiver receiver)
{
- return true;
+ throw new UnsupportedOperationException();
}
- public List browse()
+ public Iterator iterator()
{
throw new UnsupportedOperationException();
}
- public List browse(Filter filter)
+ public boolean add(Receiver receiver)
{
- throw new UnsupportedOperationException();
+ // TODO Auto-generated method stub
+ return false;
}
- public void clear()
+ public boolean remove(Receiver receiver)
{
throw new UnsupportedOperationException();
}
- public void close()
+ public int numberOfReceivers()
{
+ throw new UnsupportedOperationException();
}
- public void deliver(boolean synchronous)
+ // DeliveryObserver implementation -------------------------------
+
+ public void acknowledge(Delivery d, Transaction tx) throws Throwable
{
- throw new UnsupportedOperationException();
+ if (recoverable && d.getReference().isReliable())
+ {
+ pm.removeReference(this.channelID, d.getReference(), tx);
+ }
}
- public List delivering(Filter filter)
+ public void cancel(Delivery d) throws Throwable
{
throw new UnsupportedOperationException();
}
+ // Channel implemenation -----------------------------------------
+
public long getChannelID()
{
- return id;
+ return channelID;
}
public boolean isRecoverable()
@@ -188,93 +167,132 @@
return recoverable;
}
- public int messageCount()
+ public boolean acceptReliableMessages()
{
+ return true;
+ }
+
+ public List browse()
+ {
throw new UnsupportedOperationException();
}
- public void removeAllReferences() throws Throwable
+ public List browse(Filter filter)
{
throw new UnsupportedOperationException();
}
- public List undelivered(Filter filter)
+ public void deliver(boolean synchronous)
{
throw new UnsupportedOperationException();
}
- public void acknowledge(Delivery d, Transaction tx) throws Throwable
+ public void close()
{
- if (recoverable && d.getReference().isReliable())
- {
- pm.removeReference(this.id, d.getReference(), tx);
- }
}
- public void cancel(Delivery d) throws Throwable
+ public List delivering(Filter filter)
{
throw new UnsupportedOperationException();
}
- public boolean add(Receiver receiver)
+ public List undelivered(Filter filter)
{
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException();
}
- public boolean contains(Receiver receiver)
+ public void clear()
{
throw new UnsupportedOperationException();
}
- public Iterator iterator()
+ public int messageCount()
{
throw new UnsupportedOperationException();
}
- public boolean remove(Receiver receiver)
+ public void removeAllReferences() throws Throwable
{
throw new UnsupportedOperationException();
}
-
- public int numberOfReceivers()
+
+ public void load() throws Exception
{
- throw new UnsupportedOperationException();
}
+ public void unload() throws Exception
+ {
+ }
+
public void activate()
- {
+ {
}
public void deactivate()
- {
+ {
}
- public void load() throws Exception
- {
+ public boolean isActive()
+ {
+ throw new UnsupportedOperationException();
}
- public void unload() throws Exception
- {
- }
-
- public boolean isActive()
+ public List createDeliveries(List messageIds)
{
throw new UnsupportedOperationException();
}
-
+
+ // Queue implementation ------------------------------------------
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Filter getFilter()
+ {
+ return filter;
+ }
+
public boolean isClustered()
{
return true;
}
- public String toString()
+ // ClusteredQueue implementation ---------------------------------
+
+ public QueueStats getStats()
{
- return "RemoteQueueStub(node=" + this.nodeId + " name=" + this.name + " channelId=" + this.id + ")";
+ return stats;
}
- public List createDeliveries(List messageIds)
+ public int getNodeId()
{
- throw new UnsupportedOperationException();
+ return nodeID;
}
+
+ public boolean isLocal()
+ {
+ return false;
+ }
+
+ // Public --------------------------------------------------------
+
+ public void setStats(QueueStats stats)
+ {
+ this.stats = stats;
+ }
+
+ public String toString()
+ {
+ return "RemoteQueueStub[" + channelID + "/" + name + " -> " + nodeID + "]";
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
}
Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/SendTransactionRequest.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/SendTransactionRequest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/SendTransactionRequest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -41,53 +41,112 @@
*
*/
class SendTransactionRequest extends TransactionRequest
-{
+{
+ // Constants -----------------------------------------------------
+
static final int TYPE = 8;
-
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
private List messageHolders;
-
+
+ // Constructors --------------------------------------------------
+
SendTransactionRequest()
- {
+ {
}
-
+
SendTransactionRequest(int nodeId, long txId, List messageHolders, long channelID)
{
super(nodeId, txId, true, channelID);
-
- this.messageHolders = messageHolders;
+
+ this.messageHolders = messageHolders;
}
-
+
SendTransactionRequest(int nodeId, long txId)
{
super(nodeId, txId, false);
}
-
+
+ // TransactionRequest overrides -----------------------------------
+
+ public void read(DataInputStream in) throws Exception
+ {
+ super.read(in);
+
+ int b = in.readByte();
+ if (b == StreamUtils.NULL)
+ {
+ messageHolders = null;
+ }
+ else
+ {
+ int size = in.readInt();
+ messageHolders = new ArrayList(size);
+ for (int i = 0; i < size; i++)
+ {
+ MessageHolder holder = new MessageHolder();
+ holder.read(in);
+ messageHolders.add(holder);
+ }
+ }
+ }
+
+ public void write(DataOutputStream out) throws Exception
+ {
+ super.write(out);
+ if (messageHolders != null)
+ {
+ out.writeByte(StreamUtils.LIST);
+ out.writeInt(messageHolders.size());
+ Iterator iter = messageHolders.iterator();
+ while (iter.hasNext())
+ {
+ MessageHolder holder = (MessageHolder)iter.next();
+ holder.write(out);
+ }
+ }
+ else
+ {
+ out.writeByte(StreamUtils.NULL);
+ }
+ }
+
+ // ClusterTransaction implementation -----------------------------
+
public void commit(PostOfficeInternal office) throws Exception
{
Iterator iter = messageHolders.iterator();
-
+
while (iter.hasNext())
{
MessageHolder holder = (MessageHolder)iter.next();
-
+
office.routeFromCluster(holder.getMessage(), holder.getRoutingKey(), holder.getQueueNameToNodeIdMap());
}
}
-
+
+ public void rollback(PostOfficeInternal office) throws Exception
+ {
+ //NOOP
+ }
+
public boolean check(PostOfficeInternal office) throws Exception
{
//If the messages exist in the database then we should commit the transaction
//otherwise we should roll it back
-
+
Iterator iter = messageHolders.iterator();
-
+
//We only need to check that one of the refs made it to the database - the refs would have
//been inserted into the db transactionally, so either they're all there or none are
MessageHolder holder = (MessageHolder)iter.next();
-
+
//We store the channelID of one of the channels that the message was persisted in
//it doesn't matter which one since they were all inserted in the same tx
-
+
if (office.referenceExistsInStorage(checkChannelID, holder.getMessage().getMessageID()))
{
//We can commit
@@ -100,56 +159,34 @@
}
}
- public void rollback(PostOfficeInternal office) throws Exception
- {
- //NOOP
- }
-
+ // Public --------------------------------------------------------
+
public byte getType()
{
return TYPE;
}
-
- public void read(DataInputStream in) throws Exception
+
+ public String toString()
{
- super.read(in);
-
- int b = in.readByte();
- if (b == StreamUtils.NULL)
+ StringBuffer sb = new StringBuffer("SendTransactionRequest[");
+ for(Iterator i = messageHolders.iterator(); i.hasNext(); )
{
- messageHolders = null;
- }
- else
- {
- int size = in.readInt();
- messageHolders = new ArrayList(size);
- for (int i = 0; i < size; i++)
+ sb.append(((MessageHolder)i.next()).getMessage());
+ if (i.hasNext())
{
- MessageHolder holder = new MessageHolder();
- holder.read(in);
- messageHolders.add(holder);
+ sb.append(',');
}
}
+ sb.append("]");
+ return sb.toString();
}
- public void write(DataOutputStream out) throws Exception
- {
- super.write(out);
- if (messageHolders != null)
- {
- out.writeByte(StreamUtils.LIST);
- out.writeInt(messageHolders.size());
- Iterator iter = messageHolders.iterator();
- while (iter.hasNext())
- {
- MessageHolder holder = (MessageHolder)iter.next();
- holder.write(out);
- }
- }
- else
- {
- out.writeByte(StreamUtils.NULL);
- }
- }
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
}
Modified: trunk/src/main/org/jboss/messaging/core/tx/Transaction.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/tx/Transaction.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/tx/Transaction.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -181,7 +181,7 @@
throw new TransactionException("Transaction already rolled back, cannot commit");
}
- if (trace) { log.trace("executing before commit hooks " + this); }
+ if (trace) { log.trace(this + " executing before commit hooks"); }
boolean onePhase = state != STATE_PREPARED;
@@ -201,11 +201,11 @@
state = STATE_COMMITTED;
- if (trace) { log.trace("committed " + this); }
+ if (trace) { log.trace(this + " committed"); }
iter = callbacks.iterator();
- if (trace) { log.trace("executing after commit hooks " + this); }
+ if (trace) { log.trace(this + " executing after commit hooks"); }
if (firstCallback != null)
{
@@ -230,7 +230,7 @@
repository.deleteTransaction(this);
}
- if (trace) { log.trace("commit process complete " + this); }
+ if (trace) { log.trace(this + " commit process complete"); }
}
public synchronized void prepare() throws Exception
@@ -240,7 +240,7 @@
throw new TransactionException("Transaction not active, cannot prepare");
}
- if (trace) { log.trace("executing before prepare hooks " + this); }
+ if (trace) { log.trace(this + " executing before prepare hooks"); }
if (firstCallback != null)
{
@@ -258,7 +258,7 @@
state = STATE_PREPARED;
- if (trace) { log.trace("prepared " + this); }
+ if (trace) { log.trace(this + " prepared"); }
if (firstCallback != null)
{
@@ -267,7 +267,7 @@
iter = callbacks.iterator();
- if (trace) { log.trace("executing after prepare hooks " + this); }
+ if (trace) { log.trace(this + " executing after prepare hooks"); }
while (iter.hasNext())
{
@@ -276,7 +276,7 @@
callback.afterPrepare();
}
- if (trace) { log.trace("prepare process complete " + this); }
+ if (trace) { log.trace(this + " prepare process complete"); }
}
public synchronized void rollback() throws Exception
@@ -290,7 +290,7 @@
throw new TransactionException("Transaction already rolled back, cannot rollback");
}
- if (trace) { log.trace("executing before rollback hooks " + this); }
+ if (trace) { log.trace(this + " executing before rollback hooks"); }
boolean onePhase = state != STATE_PREPARED;
@@ -307,9 +307,9 @@
state = STATE_ROLLEDBACK;
- if (trace) { log.trace("rolled back " + this); }
+ if (trace) { log.trace(this + " rolled back"); }
- if (trace) { log.trace("executing after prepare hooks " + this); }
+ if (trace) { log.trace(this + " executing after rollback hooks"); }
if (firstCallback != null)
{
@@ -330,12 +330,12 @@
repository.deleteTransaction(this);
}
- if (trace) { log.trace("rollback process complete " + this); }
+ if (trace) { log.trace(this + " rollback process complete"); }
}
public synchronized void setRollbackOnly() throws Exception
{
- if (trace) { log.trace("setting rollback_only on " + this); }
+ if (trace) { log.trace("setting ROLLBACK_ONLY on " + this); }
state = STATE_ROLLBACK_ONLY;
}
Modified: trunk/src/main/org/jboss/messaging/core/tx/TransactionRepository.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/tx/TransactionRepository.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/src/main/org/jboss/messaging/core/tx/TransactionRepository.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -29,7 +29,7 @@
import javax.transaction.xa.Xid;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.contract.MessagingComponent;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -58,13 +58,13 @@
private PersistenceManager persistenceManager;
- private IdManager idManager;
+ private IDManager idManager;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public TransactionRepository(PersistenceManager persistenceManager, IdManager idManager)
+ public TransactionRepository(PersistenceManager persistenceManager, IDManager idManager)
{
this.persistenceManager = persistenceManager;
@@ -169,7 +169,7 @@
{
throw new TransactionException("There is already a local tx for global tx " + xid);
}
- Transaction tx = new Transaction(idManager.getId(), xid, this);
+ Transaction tx = new Transaction(idManager.getID(), xid, this);
if (trace) { log.trace("created transaction " + tx); }
@@ -180,7 +180,7 @@
public Transaction createTransaction() throws Exception
{
- Transaction tx = new Transaction(idManager.getId());
+ Transaction tx = new Transaction(idManager.getID());
if (trace) { log.trace("created transaction " + tx); }
Modified: trunk/tests/bin/runtest
===================================================================
--- trunk/tests/bin/runtest 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/bin/runtest 2006-12-19 05:15:12 UTC (rev 1816)
@@ -117,7 +117,6 @@
fi
if [ "$1" = "-clustered" ]; then
TEST_CLUSTERED=true
- TEST_LOGFILE_SUFFIX=clustering-client
shift
continue;
else
@@ -126,6 +125,10 @@
fi
done
+if [ "$TEST_CLUSTERED" = "true" ]; then
+ TEST_LOGFILE_SUFFIX=clustering-client
+fi
+
JAVA_OPTS="-Xmx1024M $JAVA_OPTS \
-Dmodule.output=$reldir/../output \
$REMOTE_TEST \
Modified: trunk/tests/src/org/jboss/test/messaging/core/SimpleDeliveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/SimpleDeliveryTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/SimpleDeliveryTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -24,7 +24,7 @@
import org.jboss.messaging.core.Delivery;
import org.jboss.messaging.core.DeliveryObserver;
import org.jboss.messaging.core.SimpleDelivery;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.tx.Transaction;
@@ -117,7 +117,7 @@
true, true, true, 100);
pm.start();
- IdManager idm = new IdManager("TRANSACTION_ID", 10, pm);
+ IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
idm.start();
TransactionRepository tr = new TransactionRepository(pm, idm);
Modified: trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -33,7 +33,7 @@
import org.jboss.messaging.core.Receiver;
import org.jboss.messaging.core.local.PagingFilteredQueue;
import org.jboss.messaging.core.message.CoreMessage;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
import org.jboss.messaging.core.plugin.contract.MessageStore;
@@ -96,7 +96,7 @@
protected PagingFilteredQueue queue;
- protected IdManager idm;
+ protected IDManager idm;
// Constructors --------------------------------------------------
@@ -119,7 +119,7 @@
true, true, true, 100);
pm.start();
- idm = new IdManager("TRANSACTION_ID", 10, pm);
+ idm = new IDManager("TRANSACTION_ID", 10, pm);
idm.start();
tr = new TransactionRepository(pm, idm);
Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -26,7 +26,6 @@
import org.jboss.messaging.core.Message;
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.local.PagingFilteredQueue;
-import org.jboss.messaging.core.plugin.IdManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.LockMap;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/base/PagingStateTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/base/PagingStateTestBase.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/base/PagingStateTestBase.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -38,7 +38,7 @@
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.Receiver;
import org.jboss.messaging.core.SimpleDelivery;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -71,7 +71,7 @@
protected PersistenceManager pm;
protected SimpleMessageStore ms;
protected TransactionRepository tr;
- protected IdManager idm;
+ protected IDManager idm;
// Constructors --------------------------------------------------
@@ -100,7 +100,7 @@
true, true, true, 100);
pm.start();
- idm = new IdManager("TRANSACTION_ID", 10, pm);
+ idm = new IDManager("TRANSACTION_ID", 10, pm);
idm.start();
tr = new TransactionRepository(pm, idm);
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/IdManagerTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/IdManagerTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/IdManagerTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -21,8 +21,8 @@
*/
package org.jboss.test.messaging.core.plugin;
-import org.jboss.messaging.core.plugin.IdBlock;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDBlock;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.test.messaging.MessagingTestCase;
@@ -90,7 +90,7 @@
public void test1() throws Exception
{
- IdManager idm = new IdManager("test_counter", 1000, pm);
+ IDManager idm = new IDManager("test_counter", 1000, pm);
idm.start();
int blockSize = 37;
@@ -99,7 +99,7 @@
for (int i = 0; i < 1000; i++)
{
- IdBlock block = idm.getIdBlock(blockSize);
+ IDBlock block = idm.getIDBlock(blockSize);
assertTrue(block.getLow() >= nextLow);
@@ -113,12 +113,12 @@
public void test2() throws Exception
{
- IdManager idm = new IdManager("test_counter2", 100, pm);
+ IDManager idm = new IDManager("test_counter2", 100, pm);
idm.start();
for (int i = 0; i < 1000; i++)
{
- long id = idm.getId();
+ long id = idm.getID();
assertEquals(i, id);
}
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/JDBCPersistenceManagerTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/JDBCPersistenceManagerTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/JDBCPersistenceManagerTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -39,7 +39,7 @@
import org.jboss.messaging.core.Channel;
import org.jboss.messaging.core.Message;
import org.jboss.messaging.core.MessageReference;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
import org.jboss.messaging.core.plugin.contract.MessageStore;
@@ -805,7 +805,7 @@
//
// Channel channel = new SimpleChannel(0, ms);
//
-// TransactionRepository txRep = new TransactionRepository(pm, new IdManager("TRANSACTION_ID", 10, pm));
+// TransactionRepository txRep = new TransactionRepository(pm, new IDManager("TRANSACTION_ID", 10, pm));
// txRep.start();
//
// Message[] messages = createMessages(10);
@@ -1160,7 +1160,7 @@
Channel channel = new SimpleChannel(0, ms);
- IdManager idm = new IdManager("TRANSACTION_ID", 10, pm);
+ IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
idm.start();
TransactionRepository txRep = new TransactionRepository(pm, idm);
@@ -1271,7 +1271,7 @@
Channel channel = new SimpleChannel(0, ms);
- IdManager idm = new IdManager("TRANSACTION_ID", 10, pm);
+ IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
idm.start();
TransactionRepository txRep = new TransactionRepository(pm, idm);
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -36,7 +36,7 @@
import org.jboss.messaging.core.Message;
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.Queue;
-import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.IDManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
import org.jboss.messaging.core.plugin.contract.Condition;
@@ -76,9 +76,9 @@
protected ServiceContainer sc;
- protected IdManager channelIdManager;
+ protected IDManager channelIDManager;
- protected IdManager transactionIdManager;
+ protected IDManager transactionIDManager;
protected PersistenceManager pm;
@@ -113,10 +113,10 @@
true, true, true, 100);
pm.start();
- transactionIdManager = new IdManager("TRANSACTION_ID", 10, pm);
- transactionIdManager.start();
+ transactionIDManager = new IDManager("TRANSACTION_ID", 10, pm);
+ transactionIDManager.start();
- tr = new TransactionRepository(pm, transactionIdManager);
+ tr = new TransactionRepository(pm, transactionIDManager);
tr.start();
ms = new SimpleMessageStore();
@@ -124,8 +124,8 @@
pool = new QueuedExecutorPool(10);
- channelIdManager = new IdManager("CHANNEL_ID", 10, pm);
- channelIdManager.start();
+ channelIDManager = new IDManager("CHANNEL_ID", 10, pm);
+ channelIDManager.start();
conditionFactory = new SimpleConditionFactory();
@@ -142,8 +142,8 @@
pm.stop();
tr.stop();
ms.stop();
- transactionIdManager.stop();
- channelIdManager.stop();
+ transactionIDManager.stop();
+ channelIDManager.stop();
super.tearDown();
}
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -99,7 +99,7 @@
Filter filter1 = new Selector("x = 'cheese'");
Filter filter2 = new Selector("y = 'bread'");
- PagingFilteredQueue queue1 = new PagingFilteredQueue("durableQueue", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("durableQueue", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding1 =
@@ -117,7 +117,7 @@
}
//Bind one non durable
- PagingFilteredQueue queue2 = new PagingFilteredQueue("nonDurableQueue", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("nonDurableQueue", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
office1.bindQueue(new SimpleCondition("condition2"), queue2);
@@ -207,42 +207,42 @@
{
office = createPostOffice();
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
office.bindQueue(new SimpleCondition("condition1"), queue1);
- PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
office.bindQueue(new SimpleCondition("condition1"), queue2);
- PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
office.bindQueue(new SimpleCondition("condition1"), queue3);
- PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding4 =
office.bindQueue(new SimpleCondition("condition1"), queue4);
- PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding5 =
office.bindQueue(new SimpleCondition("condition2"), queue5);
- PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding6 =
office.bindQueue(new SimpleCondition("condition2"), queue6);
- PagingFilteredQueue queue7 = new PagingFilteredQueue("queue7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue7 = new PagingFilteredQueue("queue7", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding7 =
office.bindQueue(new SimpleCondition("condition2"), queue7);
- PagingFilteredQueue queue8 = new PagingFilteredQueue("queue8", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue8 = new PagingFilteredQueue("queue8", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding8 =
office.bindQueue(new SimpleCondition("condition2"), queue8);
@@ -333,32 +333,32 @@
postOffice = createPostOffice();
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
- PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
- PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
- PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding4 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
- PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding5 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
- PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding6 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
@@ -485,7 +485,7 @@
{
postOffice = createPostOffice();
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
postOffice.bindQueue(new SimpleCondition("condition1"), queue1);
@@ -537,17 +537,17 @@
SimpleFilter filter = new SimpleFilter(2);
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), filter);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), filter);
Binding binding1 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
- PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
- PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
@@ -639,32 +639,32 @@
{
postOffice = createPostOffice();
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
- PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
- PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
- PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding4 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
- PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding5 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
- PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding6 =
postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
@@ -813,12 +813,12 @@
{
postOffice = createPostOffice();
- PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
- PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding2 =
postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -158,11 +158,11 @@
//Add a couple of bindings
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "sub1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office1, 1, "sub2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
@@ -180,7 +180,7 @@
//Add another binding on node 2
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "sub3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
@@ -207,7 +207,7 @@
//Add another binding on node 1
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office2, 2, "sub4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue4);
@@ -271,7 +271,7 @@
//Add another binding on node 3
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office3, 3, "sub5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office3, 3, "sub5", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 =
office3.bindClusteredQueue(new SimpleCondition("topic1"), queue5);
@@ -307,12 +307,12 @@
//Add a durable and a non durable binding on node 1
- LocalClusteredQueue queue6 = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue6 = new LocalClusteredQueue(office1, 1, "sub6", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding6 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue6);
- LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "sub7", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding7 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue7);
@@ -598,15 +598,15 @@
office2 = createClusteredPostOffice(2, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
try
{
@@ -617,7 +617,7 @@
{
//Ok
}
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
try
{
@@ -633,11 +633,11 @@
office1.unbindClusteredQueue("queue1");
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
- PagingFilteredQueue queue6 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
+ PagingFilteredQueue queue6 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
try
{
Binding binding6 = office1.bindQueue(new SimpleCondition("queue1"), queue6);
@@ -651,13 +651,13 @@
office1.unbindClusteredQueue("queue1");
//It should be possible to bind queues locally into a clustered post office
- LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding7 = office1.bindQueue(new SimpleCondition("queue1"), queue7);
- LocalClusteredQueue queue8 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue8 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding8 = office2.bindQueue(new SimpleCondition("queue1"), queue8);
- LocalClusteredQueue queue9 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue9 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
try
{
Binding binding9 = office1.bindQueue(new SimpleCondition("queue1"), queue9);
@@ -701,15 +701,15 @@
SimpleFilter filter1 = new SimpleFilter(2);
SimpleFilter filter2 = new SimpleFilter(3);
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter1, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter1, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter2, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter2, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "queue3", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "queue3", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
@@ -810,52 +810,52 @@
LocalClusteredQueue[] queues = new LocalClusteredQueue[16];
Binding[] bindings = new Binding[16];
- queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[0] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[0]);
- queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[1] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[1]);
- queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[2] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[2]);
- queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[3] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[3]);
- queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[4] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[4]);
- queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[5] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[5]);
- queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[6] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[6]);
- queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[7] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[7]);
- queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[8] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[8]);
- queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[9] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[9]);
- queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[10] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[10]);
- queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[11] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[11]);
- queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[12] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[12]);
- queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[13] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[13]);
- queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[14] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[14]);
- queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[15] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[15]);
SimpleReceiver[] receivers = new SimpleReceiver[16];
@@ -1000,27 +1000,27 @@
//We deploy the queue on nodes 1, 2, 3, 4 and 5
//We don't deploy on node 6
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
@@ -1153,17 +1153,17 @@
office2 = createClusteredPostOffice(2, "testgroup");
office3 = createClusteredPostOffice(3, "testgroup");
- LocalClusteredQueue sub1 = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sub1 = new LocalClusteredQueue(office1, 1, "sub1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office1.bindQueue(new SimpleCondition("topic"), sub1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub1.add(receiver1);
- LocalClusteredQueue sub2 = new LocalClusteredQueue(office2, 2, "sub2", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sub2 = new LocalClusteredQueue(office2, 2, "sub2", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindQueue(new SimpleCondition("topic"), sub2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub2.add(receiver2);
- LocalClusteredQueue sub3 = new LocalClusteredQueue(office3, 3, "sub3", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sub3 = new LocalClusteredQueue(office3, 3, "sub3", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office3.bindQueue(new SimpleCondition("topic"), sub3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub3.add(receiver3);
@@ -1270,13 +1270,13 @@
//======
//Non durable 1 on node 2
- LocalClusteredQueue nonDurable1 = new LocalClusteredQueue(office2, 2, "nondurable1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable1 = new LocalClusteredQueue(office2, 2, "nondurable1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), nonDurable1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable1.add(receiver1);
//Non durable 2 on node 2
- LocalClusteredQueue nonDurable2 = new LocalClusteredQueue(office2, 2, "nondurable2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable2 = new LocalClusteredQueue(office2, 2, "nondurable2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("topic"), nonDurable2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable2.add(receiver2);
@@ -1285,13 +1285,13 @@
//======
//Non shared durable
- LocalClusteredQueue nonSharedDurable1 = new LocalClusteredQueue(office3, 3, "nonshareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonSharedDurable1 = new LocalClusteredQueue(office3, 3, "nonshareddurable1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("topic"), nonSharedDurable1);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonSharedDurable1.add(receiver3);
//Non durable
- LocalClusteredQueue nonDurable3 = new LocalClusteredQueue(office3, 3, "nondurable3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable3 = new LocalClusteredQueue(office3, 3, "nondurable3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office3.bindClusteredQueue(new SimpleCondition("topic"), nonDurable3);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable3.add(receiver4);
@@ -1300,31 +1300,31 @@
//======
//Shared durable
- LocalClusteredQueue sharedDurable1 = new LocalClusteredQueue(office4, 4, "shareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sharedDurable1 = new LocalClusteredQueue(office4, 4, "shareddurable1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office4.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable1);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable1.add(receiver5);
//Non shared durable
- LocalClusteredQueue nonSharedDurable2 = new LocalClusteredQueue(office4, 4, "nonshareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonSharedDurable2 = new LocalClusteredQueue(office4, 4, "nonshareddurable2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding6 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonSharedDurable2);
SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonSharedDurable2.add(receiver6);
//Non durable
- LocalClusteredQueue nonDurable4 = new LocalClusteredQueue(office4, 4, "nondurable4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable4 = new LocalClusteredQueue(office4, 4, "nondurable4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding7 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable4);
SimpleReceiver receiver7 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable4.add(receiver7);
// Non durable
- LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding8 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable5);
SimpleReceiver receiver8 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable5.add(receiver8);
//Non durable
- LocalClusteredQueue nonDurable6 = new LocalClusteredQueue(office4, 4, "nondurable6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable6 = new LocalClusteredQueue(office4, 4, "nondurable6", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding9 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable6);
SimpleReceiver receiver9 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable6.add(receiver9);
@@ -1332,32 +1332,32 @@
// Node 5
//=======
//Shared durable
- LocalClusteredQueue sharedDurable2 = new LocalClusteredQueue(office5, 5, "shareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sharedDurable2 = new LocalClusteredQueue(office5, 5, "shareddurable1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding10 = office5.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable2);
SimpleReceiver receiver10 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable2.add(receiver10);
//Shared durable
- LocalClusteredQueue sharedDurable3 = new LocalClusteredQueue(office5, 5, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sharedDurable3 = new LocalClusteredQueue(office5, 5, "shareddurable2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding11 = office5.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable3);
SimpleReceiver receiver11 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable3.add(receiver11);
// Node 6
//=========
- LocalClusteredQueue sharedDurable4 = new LocalClusteredQueue(office6, 6, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sharedDurable4 = new LocalClusteredQueue(office6, 6, "shareddurable2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding12 = office6.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable4);
SimpleReceiver receiver12 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable4.add(receiver12);
- LocalClusteredQueue nonDurable7 = new LocalClusteredQueue(office6, 6, "nondurable7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue nonDurable7 = new LocalClusteredQueue(office6, 6, "nondurable7", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding13 = office6.bindClusteredQueue(new SimpleCondition("topic"), nonDurable7);
SimpleReceiver receiver13 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable7.add(receiver13);
//Node 7
//=======
- LocalClusteredQueue sharedDurable5 = new LocalClusteredQueue(office7, 7, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue sharedDurable5 = new LocalClusteredQueue(office7, 7, "shareddurable2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding14 = office7.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable5);
SimpleReceiver receiver14 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable5.add(receiver14);
@@ -1689,52 +1689,52 @@
LocalClusteredQueue[] queues = new LocalClusteredQueue[16];
Binding[] bindings = new Binding[16];
- queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[0] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[0]);
- queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[1] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[1]);
- queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[2] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[2]);
- queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[3] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[3]);
- queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[4] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[4]);
- queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[5] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[5]);
- queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[6] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[6]);
- queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[7] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[7]);
- queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[8] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[8]);
- queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[9] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[9]);
- queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[10] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[10]);
- queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[11] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[11]);
- queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[12] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[12]);
- queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
bindings[13] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[13]);
- queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[14] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[14]);
- queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
bindings[15] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[15]);
SimpleReceiver[] receivers = new SimpleReceiver[16];
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -128,27 +128,27 @@
office6 = createClusteredPostOffice(6, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
@@ -269,27 +269,27 @@
office6 = createClusteredPostOffice(6, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIDManager.getID(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -101,15 +101,15 @@
office3 = (DefaultClusteredPostOffice)createClusteredPostOffice(3, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
@@ -236,15 +236,15 @@
office3 = (DefaultClusteredPostOffice)createClusteredPostOffice(3, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -144,11 +144,11 @@
office2 = (DefaultClusteredPostOffice)createClusteredPostOffice(2, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
@@ -238,11 +238,11 @@
office2 = (DefaultClusteredPostOffice)createClusteredPostOffice(2, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
@@ -338,11 +338,11 @@
office2 = (DefaultClusteredPostOffice)createClusteredPostOffice(2, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
@@ -434,11 +434,11 @@
office2 = (DefaultClusteredPostOffice)createClusteredPostOffice(2, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
@@ -533,19 +533,19 @@
office5 = (DefaultClusteredPostOffice)createClusteredPostOffice(5, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
final int NUM_MESSAGES = 100;
@@ -693,19 +693,19 @@
office5 = (DefaultClusteredPostOffice)createClusteredPostOffice(5, "testgroup");
- LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
- LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
- LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
- LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
- LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
+ LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
final int NUM_MESSAGES = 100;
Modified: trunk/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -56,7 +56,7 @@
import org.jboss.jms.tx.TransactionRequest;
import org.jboss.jms.tx.ClientTransaction.SessionTxState;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdBlock;
+import org.jboss.messaging.core.plugin.IDBlock;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvocationResponse;
import org.jboss.remoting.InvokerLocator;
@@ -1363,7 +1363,7 @@
public void testGetIdBlockResponse() throws Exception
{
- IdBlock block = new IdBlock(132, 465);
+ IDBlock block = new IDBlock(132, 465);
MessagingMarshallable mm = new MessagingMarshallable((byte)77, block);
@@ -1388,7 +1388,7 @@
assertEquals(JMSWireFormat.ID_BLOCK_RESPONSE, b);
- IdBlock block2 = new IdBlock();
+ IDBlock block2 = new IDBlock();
block2.read(dis);
@@ -1416,7 +1416,7 @@
assertEquals(77, mm.getVersion());
- IdBlock block3 = (IdBlock)mm.getLoad();
+ IDBlock block3 = (IDBlock)mm.getLoad();
assertEquals(block.getLow(), block3.getLow());
assertEquals(block.getHigh(), block3.getHigh());
Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/DistributedDestinationsTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/DistributedDestinationsTest.java 2006-12-18 22:59:52 UTC (rev 1815)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/DistributedDestinationsTest.java 2006-12-19 05:15:12 UTC (rev 1816)
@@ -546,150 +546,141 @@
}
}
-
-
- /*
- * Create durable subscriptions on all nodes of the cluster.
- * Include a couple with selectors
- * Ensure all messages are receive as appropriate
- * None of the durable subs are shared
+ /**
+ * Create durable subscriptions on all nodes of the cluster. Include a couple with selectors.
+ * Ensure all messages are receive as appropriate. None of the durable subs are shared.
*/
private void clusteredTopicDurable(boolean persistent) throws Exception
{
+ Connection conn0 = null;
Connection conn1 = null;
Connection conn2 = null;
- Connection conn3 = null;
+
try
{
- //This will create 3 different connection on 3 different nodes, since
- //the cf is clustered
+ // This will create 3 different connection on 3 different nodes, since the cf is clustered
+ conn0 = cf.createConnection();
conn1 = cf.createConnection();
conn2 = cf.createConnection();
- conn3 = cf.createConnection();
log.info("Created connections");
- checkConnectionsDifferentServers(new Connection[] {conn1, conn2, conn3});
+ checkConnectionsDifferentServers(new Connection[] {conn0, conn1, conn2});
+ conn0.setClientID("wib1");
conn1.setClientID("wib1");
conn2.setClientID("wib1");
- conn3.setClientID("wib1");
+ Session sess0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
Session sess2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Session sess3 = conn3.createSession(false, Session.AUTO_ACKNOWLEDGE);
try
{
- sess1.unsubscribe("sub");
+ sess0.unsubscribe("alpha");
}
catch (Exception ignore) {}
try
{
- sess2.unsubscribe("sub1");
+ sess1.unsubscribe("beta");
}
catch (Exception ignore) {}
try
{
- sess3.unsubscribe("sub2");
+ sess2.unsubscribe("gamma");
}
catch (Exception ignore) {}
try
{
- sess1.unsubscribe("sub3");
+ sess0.unsubscribe("delta");
}
catch (Exception ignore) {}
try
{
- sess2.unsubscribe("sub4");
+ sess1.unsubscribe("epsilon");
}
catch (Exception ignore) {}
- MessageConsumer cons1 = sess1.createDurableSubscriber(topic[0], "sub");
- MessageConsumer cons2 = sess2.createDurableSubscriber(topic[1], "sub1");
- MessageConsumer cons3 = sess3.createDurableSubscriber(topic[2], "sub2");
- MessageConsumer cons4 = sess1.createDurableSubscriber(topic[0], "sub3");
- MessageConsumer cons5 = sess2.createDurableSubscriber(topic[1], "sub4");
+ MessageConsumer alpha = sess0.createDurableSubscriber(topic[0], "alpha");
+ MessageConsumer beta = sess1.createDurableSubscriber(topic[1], "beta");
+ MessageConsumer gamma = sess2.createDurableSubscriber(topic[2], "gamma");
+ MessageConsumer delta = sess0.createDurableSubscriber(topic[0], "delta");
+ MessageConsumer epsilon = sess1.createDurableSubscriber(topic[1], "epsilon");
+ conn0.start();
conn1.start();
conn2.start();
- conn3.start();
// Send at node 0
- MessageProducer prod = sess1.createProducer(topic[0]);
+ MessageProducer prod = sess0.createProducer(topic[0]);
prod.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- final int NUM_MESSAGES = 100;
+ final int NUM_MESSAGES = 1;
+ log.info("sending messages");
+
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = sess2.createTextMessage("message" + i);
-
- prod.send(tm);
+ prod.send(sess0.createTextMessage("message" + i));
}
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = (TextMessage)cons1.receive(1000);
-
+ TextMessage tm = (TextMessage)alpha.receive(1000);
assertNotNull(tm);
-
assertEquals("message" + i, tm.getText());
}
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = (TextMessage)cons2.receive(1000);
-
+ TextMessage tm = (TextMessage)beta.receive(1000);
assertNotNull(tm);
-
assertEquals("message" + i, tm.getText());
}
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = (TextMessage)cons3.receive(1000);
-
+ TextMessage tm = (TextMessage)gamma.receive(1000);
assertNotNull(tm);
-
assertEquals("message" + i, tm.getText());
}
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = (TextMessage)cons4.receive(1000);
-
+ TextMessage tm = (TextMessage)delta.receive(1000);
assertNotNull(tm);
-
assertEquals("message" + i, tm.getText());
}
for (int i = 0; i < NUM_MESSAGES; i++)
{
- TextMessage tm = (TextMessage)cons5.receive(1000);
-
+ TextMessage tm = (TextMessage)epsilon.receive(1000);
assertNotNull(tm);
-
assertEquals("message" + i, tm.getText());
}
- cons1.close();
- cons2.close();
- cons3.close();
- cons4.close();
- cons5.close();
+ alpha.close();
+ beta.close();
+ gamma.close();
+ delta.close();
+ epsilon.close();
- sess1.unsubscribe("sub");
- sess2.unsubscribe("sub1");
- sess3.unsubscribe("sub2");
- sess1.unsubscribe("sub3");
- sess2.unsubscribe("sub4");
+ sess0.unsubscribe("alpha");
+ sess1.unsubscribe("beta");
+ sess2.unsubscribe("gamma");
+ sess0.unsubscribe("delta");
+ sess1.unsubscribe("epsilon");
}
finally
{
+ if (conn0 != null)
+ {
+ conn0.close();
+ }
+
if (conn1 != null)
{
conn1.close();
@@ -699,11 +690,6 @@
{
conn2.close();
}
-
- if (conn3 != null)
- {
- conn3.close();
- }
}
}
More information about the jboss-cvs-commits
mailing list