Author: jbertram
Date: 2012-02-10 12:03:56 -0500 (Fri, 10 Feb 2012)
New Revision: 12107
Added:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CreateQueueIdempotentTest.java
Modified:
trunk/hornetq-core/src/main/java/
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/SimpleAddressManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
Log:
[HORNETQ-847] createQueue not idempotent
Property changes on: trunk/hornetq-core/src/main/java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/Branch_2_2_AS7/src/main:12099-12106
/branches/HORNETQ-720_Replication/hornetq-core/src/main/java:10878-11528
/branches/STOMP11/hornetq-core/src/main/java:11225-11517
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/StorageManager.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -200,6 +200,10 @@
void commit(long txID, boolean lineUpContext) throws Exception;
void rollback(long txID) throws Exception;
+
+ void rollbackBindings(long txID) throws Exception;
+
+ void commitBindings(long txID) throws Exception;
void storePageTransaction(long txID, PageTransactionInfo pageTransaction) throws
Exception;
@@ -224,7 +228,7 @@
// Bindings related operations
- void addQueueBinding(Binding binding) throws Exception;
+ void addQueueBinding(long tx, Binding binding) throws Exception;
void deleteQueueBinding(long queueBindingID) throws Exception;
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -1182,9 +1182,20 @@
commit(txID, true);
}
- public void commit(final long txID, final boolean lineUpContext) throws Exception
- {
- readLock();
+ public void commitBindings(final long txID) throws Exception
+ {
+ bindingsJournal.appendCommitRecord(txID, true);
+ }
+
+ public void rollbackBindings(final long txID) throws Exception
+ {
+ // no need to sync, it's going away anyways
+ bindingsJournal.appendRollbackRecord(txID, false);
+ }
+
+ public void commit(final long txID, final boolean lineUpContext) throws Exception
+ {
+ readLock();
try
{
messageJournal.appendCommitRecord(txID, syncTransactional,
getContext(syncTransactional), lineUpContext);
@@ -1900,7 +1911,7 @@
// Bindings operations
- public void addQueueBinding(final Binding binding) throws Exception
+ public void addQueueBinding(final long tx, final Binding binding) throws Exception
{
Queue queue = (Queue)binding.getBindable();
@@ -1912,6 +1923,7 @@
binding.getAddress(),
filterString);
+<<<<<<< .working
readLock();
try
{
@@ -1924,6 +1936,11 @@
{
readUnLock();
}
+=======
+ bindingsJournal.appendAddRecordTransactional(tx, binding.getID(),
+ JournalStorageManager.QUEUE_BINDING_RECORD,
+ bindingEncoding);
+>>>>>>> .merge-right.r12106
}
public void deleteQueueBinding(final long queueBindingID) throws Exception
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -13,16 +13,6 @@
package org.hornetq.core.persistence.impl.nullpm;
-import java.nio.ByteBuffer;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Executor;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.transaction.xa.Xid;
-
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
@@ -55,6 +45,15 @@
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.transaction.Transaction;
+import javax.transaction.xa.Xid;
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Executor;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
*
* A NullStorageManager
@@ -146,10 +145,18 @@
{
}
- public void storeReference(final long queueID, final long messageID, final boolean
last) throws Exception
+ public void rollbackBindings(long txID) throws Exception
{
}
+ public void commitBindings(long txID) throws Exception
+ {
+ }
+
+ public void storeReference(final long queueID, final long messageID, final boolean
last) throws Exception
+ {
+ }
+
public void storeReferenceTransactional(final long txID, final long queueID, final
long messageID) throws Exception
{
}
@@ -233,7 +240,11 @@
{
}
- /* (non-Javadoc)
+ public void addQueueBinding(long tx, Binding binding) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#createLargeMessageStorage(long,
int, int)
*/
public LargeServerMessage createLargeMessage()
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/SimpleAddressManager.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/SimpleAddressManager.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/SimpleAddressManager.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -16,6 +16,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Address;
@@ -56,7 +57,7 @@
{
if (nameMap.putIfAbsent(binding.getUniqueName(), binding) != null)
{
- throw new IllegalStateException("Binding already exists " + binding);
+ throw new HornetQException(HornetQException.QUEUE_EXISTS, "Binding already
exists " + binding);
}
if (log.isDebugEnabled())
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -1671,6 +1671,7 @@
Filter filter = FilterImpl.createFilter(filterString);
+ long txID = storageManager.generateUniqueID();;
long queueID = storageManager.generateUniqueID();
PageSubscription pageSubscription;
@@ -1698,10 +1699,28 @@
if (durable)
{
- storageManager.addQueueBinding(binding);
+ storageManager.addQueueBinding(txID, binding);
}
- postOffice.addBinding(binding);
+ try
+ {
+ postOffice.addBinding(binding);
+ if (durable)
+ {
+ storageManager.commitBindings(txID);
+ }
+ }
+ catch (Exception e)
+ {
+ if (durable)
+ {
+ storageManager.rollbackBindings(txID);
+ }
+ queue.close();
+ pageSubscription.close();
+ throw e;
+ }
+
managementService.registerAddress(address);
managementService.registerQueue(queue, address, storageManager);
Property changes on:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client:12099-12106
/branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client:10878-11528
/branches/STOMP11/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client:11225-11517
Copied:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CreateQueueIdempotentTest.java
(from rev 12106,
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/CreateQueueIdempotentTest.java)
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CreateQueueIdempotentTest.java
(rev 0)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CreateQueueIdempotentTest.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.client;
+
+import junit.framework.Assert;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.ServerLocator;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.ServiceTestBase;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class CreateQueueIdempotentTest extends ServiceTestBase
+{
+ private static final Logger log = Logger.getLogger(CreateQueueIdempotentTest.class);
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public void testSequentialCreateQueueIdempotency() throws Exception
+ {
+ boolean success = false;
+ final SimpleString QUEUE = new
SimpleString("SequentialCreateQueueIdempotency");
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setSecurityEnabled(false);
+
+ conf.getAcceptorConfigurations().add(new
TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
+
+ HornetQServer server = HornetQServers.newHornetQServer(conf, true);
+
+ server.start();
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSessionFactory sf = locator.createSessionFactory();
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.createQueue(QUEUE, QUEUE, null, true);
+
+ try
+ {
+ session.createQueue(QUEUE, QUEUE, null, true);
+ }
+ catch (Exception e)
+ {
+ if (e instanceof HornetQException)
+ {
+ if (((HornetQException) e).getCode() == 101)
+ {
+ success = true;
+ }
+ }
+ }
+
+ session.close();
+
+ locator.close();
+
+ server.stop();
+
+ Assert.assertTrue(success);
+ }
+
+ public void testConcurrentCreateQueueIdempotency() throws Exception
+ {
+ boolean success = true;
+ final String QUEUE = "ConcurrentCreateQueueIdempotency";
+ AtomicInteger queuesCreated = new AtomicInteger(0);
+ AtomicInteger failedAttempts = new AtomicInteger(0);
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setSecurityEnabled(false);
+
+ conf.getAcceptorConfigurations().add(new
TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
+
+ HornetQServer server = HornetQServers.newHornetQServer(conf, true);
+
+ server.start();
+ final int NUM_THREADS = 5;
+
+ QueueCreator[] queueCreators = new QueueCreator[NUM_THREADS];
+
+
+ for(int i = 0; i < NUM_THREADS; i++)
+ {
+ QueueCreator queueCreator = new QueueCreator(QUEUE, queuesCreated,
failedAttempts);
+ queueCreators[i] = queueCreator;
+ }
+
+ for(int i = 0; i < NUM_THREADS; i++)
+ {
+ queueCreators[i].start();
+ }
+
+ for(int i = 0; i < NUM_THREADS; i++)
+ {
+ queueCreators[i].join();
+ }
+
+ server.stop();
+
+ // re-starting the server appears to be an unreliable guide
+ try
+ {
+ server.start();
+ } catch (Exception e)
+ {
+ System.out.println("THIS BLEW UP!!");
+ e.printStackTrace();
+ success = false;
+ }
+
+ server.stop();
+
+ Assert.assertTrue(success);
+ Assert.assertEquals(1, queuesCreated.intValue());
+ Assert.assertEquals(NUM_THREADS - 1, failedAttempts.intValue());
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+ class QueueCreator extends Thread
+ {
+ private String queueName = null;
+ private AtomicInteger queuesCreated = null;
+ private AtomicInteger failedAttempts = null;
+
+
+ QueueCreator(String queueName, AtomicInteger queuesCreated, AtomicInteger
failedAttempts)
+ {
+ this.queueName = queueName;
+ this.queuesCreated = queuesCreated;
+ this.failedAttempts = failedAttempts;
+ }
+ @Override
+ public void run()
+ {
+ ServerLocator locator = null;
+ ClientSession session = null;
+
+ try
+ {
+ locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+ ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true);
+ final SimpleString QUEUE = new SimpleString(queueName);
+ session.createQueue(QUEUE, QUEUE, null, true);
+ queuesCreated.incrementAndGet();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ if (e instanceof HornetQException)
+ {
+ if (((HornetQException) e).getCode() == 101)
+ {
+ failedAttempts.incrementAndGet();
+ }
+ }
+ }
+ finally
+ {
+ if (locator != null) {
+ locator.close();
+ }
+ if (session != null) {
+ try {
+ session.close();
+ } catch (HornetQException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+}
Property changes on:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl
___________________________________________________________________
Added: svn:mergeinfo
+
/branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/core/paging/impl:12099-12106
/branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl:10878-11528
/branches/STOMP11/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl:11225-11517
Modified:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
---
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2012-02-10
02:11:36 UTC (rev 12106)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2012-02-10
17:03:56 UTC (rev 12107)
@@ -33,12 +33,7 @@
import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
-import org.hornetq.core.paging.Page;
-import org.hornetq.core.paging.PageTransactionInfo;
-import org.hornetq.core.paging.PagedMessage;
-import org.hornetq.core.paging.PagingManager;
-import org.hornetq.core.paging.PagingStore;
-import org.hornetq.core.paging.PagingStoreFactory;
+import org.hornetq.core.paging.*;
import org.hornetq.core.paging.impl.PageTransactionInfoImpl;
import org.hornetq.core.paging.impl.PagingStoreImpl;
import org.hornetq.core.persistence.StorageManager;
@@ -56,6 +51,13 @@
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.ExecutorFactory;
+import javax.transaction.xa.Xid;
+import java.nio.ByteBuffer;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
*
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
@@ -944,6 +946,795 @@
// Inner classes -------------------------------------------------
+ class FakePagingManager implements PagingManager
+ {
+
+ public void activate()
+ {
+ }
+
+ public long addSize(final long size)
+ {
+ return 0;
+ }
+
+ public void addTransaction(final PageTransactionInfo pageTransaction)
+ {
+ }
+
+ public PagingStore createPageStore(final SimpleString destination) throws
Exception
+ {
+ return null;
+ }
+
+ public long getTotalMemory()
+ {
+ return 0;
+ }
+
+ public SimpleString[] getStoreNames()
+ {
+ return null;
+ }
+
+ public long getMaxMemory()
+ {
+ return 0;
+ }
+
+ public PagingStore getPageStore(final SimpleString address) throws Exception
+ {
+ return null;
+ }
+
+ public void deletePageStore(SimpleString storeName) throws Exception
+ {
+ }
+
+ public PageTransactionInfo getTransaction(final long transactionID)
+ {
+ return null;
+ }
+
+ public boolean isBackup()
+ {
+ return false;
+ }
+
+ public boolean isGlobalPageMode()
+ {
+ return false;
+ }
+
+ public boolean isPaging(final SimpleString destination) throws Exception
+ {
+ return false;
+ }
+
+ public boolean page(final ServerMessage message, final boolean duplicateDetection)
throws Exception
+ {
+ return false;
+ }
+
+ public boolean page(final ServerMessage message, final long transactionId, final
boolean duplicateDetection) throws Exception
+ {
+ return false;
+ }
+
+ public void reloadStores() throws Exception
+ {
+ }
+
+ public void removeTransaction(final long transactionID)
+ {
+
+ }
+
+ public void setGlobalPageMode(final boolean globalMode)
+ {
+ }
+
+ public void setPostOffice(final PostOffice postOffice)
+ {
+ }
+
+ public void resumeDepages()
+ {
+ }
+
+ public void sync(final Collection<SimpleString> destinationsToSync) throws
Exception
+ {
+ }
+
+ public boolean isStarted()
+ {
+ return false;
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop() throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.paging.PagingManager#isGlobalFull()
+ */
+ public boolean isGlobalFull()
+ {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.paging.PagingManager#getTransactions()
+ */
+ public Map<Long, PageTransactionInfo> getTransactions()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.paging.PagingManager#processReload()
+ */
+ public void processReload()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.settings.HierarchicalRepositoryChangeListener#onChange()
+ */
+ public void onChange()
+ {
+ }
+
+ }
+
+ class FakeStorageManager implements StorageManager
+ {
+
+ public void setUniqueIDSequence(final long id)
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#addQueueBinding(org.hornetq.core.postoffice.Binding)
+ */
+ public void addQueueBinding(final Binding binding) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#commit(long)
+ */
+ public void commit(final long txID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#createLargeMessage()
+ */
+ public LargeServerMessage createLargeMessage()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deleteDuplicateID(long)
+ */
+ public void deleteDuplicateID(final long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#deleteDuplicateIDTransactional(long, long)
+ */
+ public void deleteDuplicateIDTransactional(final long txID, final long recordID)
throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deleteMessage(long)
+ */
+ public void deleteMessage(final long messageID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#deleteMessageTransactional(long, long, long)
+ */
+ public void deleteMessageTransactional(final long txID, final long queueID, final
long messageID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deletePageTransactional(long,
long)
+ */
+ public void deletePageTransactional(final long txID, final long recordID) throws
Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deleteQueueBinding(long)
+ */
+ public void deleteQueueBinding(final long queueBindingID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#generateUniqueID()
+ */
+ public long generateUniqueID()
+ {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#getCurrentUniqueID()
+ */
+ public long getCurrentUniqueID()
+ {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#loadBindingJournal(java.util.List)
+ */
+ public JournalLoadInformation loadBindingJournal(final List<QueueBindingInfo>
queueBindingInfos,
+ final List<GroupingInfo>
groupingInfos) throws Exception
+ {
+ return new JournalLoadInformation();
+ }
+
+ public void addGrouping(final GroupBinding groupBinding) throws Exception
+ {
+ // To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void deleteGrouping(final GroupBinding groupBinding) throws Exception
+ {
+ // To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void sync()
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#loadMessageJournal(org.hornetq.core.paging.PagingManager,
java.util.Map, org.hornetq.core.transaction.ResourceManager, java.util.Map)
+ */
+ public JournalLoadInformation loadMessageJournal(final PostOffice postOffice,
+ final PagingManager
pagingManager,
+ final ResourceManager
resourceManager,
+ final Map<Long, Queue>
queues,
+ Map<Long, QueueBindingInfo>
queueInfos,
+ final Map<SimpleString,
List<Pair<byte[], Long>>> duplicateIDMap,
+ Set<Pair<Long, Long>>
pendingLargeMessages) throws Exception
+ {
+ return new JournalLoadInformation();
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#prepare(long,
javax.transaction.xa.Xid)
+ */
+ public void prepare(final long txID, final Xid xid) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#rollback(long)
+ */
+ public void rollback(final long txID) throws Exception
+ {
+ }
+
+ public void rollbackBindings(long txID) throws Exception
+ {
+ }
+
+ public void commitBindings(long txID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storeAcknowledge(long, long)
+ */
+ public void storeAcknowledge(final long queueID, final long messageID) throws
Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeAcknowledgeTransactional(long, long,
long)
+ */
+ public void storeAcknowledgeTransactional(final long txID, final long queueID,
final long messageID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeDuplicateID(org.hornetq.utils.SimpleString,
byte[], long)
+ */
+ public void storeDuplicateID(final SimpleString address, final byte[] duplID, final
long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeDuplicateIDTransactional(long,
org.hornetq.utils.SimpleString, byte[], long)
+ */
+ public void storeDuplicateIDTransactional(final long txID,
+ final SimpleString address,
+ final byte[] duplID,
+ final long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeMessage(org.hornetq.core.server.ServerMessage)
+ */
+ public void storeMessage(final ServerMessage message) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storeMessageTransactional(long,
org.hornetq.core.server.ServerMessage)
+ */
+ public void storeMessageTransactional(final long txID, final ServerMessage message)
throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storePageTransaction(long,
org.hornetq.core.paging.PageTransactionInfo)
+ */
+ public void storePageTransaction(final long txID, final PageTransactionInfo
pageTransaction) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storeReference(long, long)
+ */
+ public void storeReference(final long queueID, final long messageID) throws
Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeReferenceTransactional(long, long, long)
+ */
+ public void storeReferenceTransactional(final long txID, final long queueID, final
long messageID) throws Exception
+ {
+ }
+
+ public long storeHeuristicCompletion(final Xid xid, final boolean isCommit) throws
Exception
+ {
+ return -1;
+ }
+
+ public void deleteHeuristicCompletion(final long txID) throws Exception
+ {
+ }
+
+ public void addQueueBinding(long tx, Binding binding) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updateDeliveryCount(org.hornetq.core.server.MessageReference)
+ */
+ public void updateDeliveryCount(final MessageReference ref) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updateDuplicateID(org.hornetq.utils.SimpleString,
byte[], long)
+ */
+ public void updateDuplicateID(final SimpleString address, final byte[] duplID,
final long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updateDuplicateIDTransactional(long,
org.hornetq.utils.SimpleString, byte[], long)
+ */
+ public void updateDuplicateIDTransactional(final long txID,
+ final SimpleString address,
+ final byte[] duplID,
+ final long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updateScheduledDeliveryTime(org.hornetq.core.server.MessageReference)
+ */
+ public void updateScheduledDeliveryTime(final MessageReference ref) throws
Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updateScheduledDeliveryTimeTransactional(long,
org.hornetq.core.server.MessageReference)
+ */
+ public void updateScheduledDeliveryTimeTransactional(final long txID, final
MessageReference ref) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.HornetQComponent#isStarted()
+ */
+ public boolean isStarted()
+ {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.HornetQComponent#start()
+ */
+ public void start() throws Exception
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.HornetQComponent#stop()
+ */
+ public void stop() throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#afterReplicated(java.lang.Runnable)
+ */
+ public void afterCompleteOperations(final Runnable run)
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#completeReplication()
+ */
+ public void completeOperations()
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#createLargeMessage(byte[])
+ */
+ public LargeServerMessage createLargeMessage(final long messageId, final
MessageInternal msg)
+ {
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#isReplicated()
+ */
+ public boolean isReplicated()
+ {
+
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#loadInternalOnly()
+ */
+ public JournalLoadInformation[] loadInternalOnly() throws Exception
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#pageClosed(org.hornetq.utils.SimpleString,
int)
+ */
+ public void pageClosed(final SimpleString storeName, final int pageNumber)
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#pageDeleted(org.hornetq.utils.SimpleString,
int)
+ */
+ public void pageDeleted(final SimpleString storeName, final int pageNumber)
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#pageWrite(org.hornetq.core.paging.PagedMessage,
int)
+ */
+ public void pageWrite(final PagedMessage message, final int pageNumber)
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#blockOnReplication(long)
+ */
+ public boolean waitOnOperations(final long timeout) throws Exception
+ {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#setReplicator(org.hornetq.core.replication.ReplicationManager)
+ */
+ public void setReplicator(final ReplicationManager replicator)
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#afterCompleteOperations(org.hornetq.core.journal.IOCompletion)
+ */
+ public void afterCompleteOperations(final IOAsyncTask run)
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#waitOnOperations()
+ */
+ public void waitOnOperations() throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#getContext()
+ */
+ public OperationContext getContext()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#newContext(java.util.concurrent.Executor)
+ */
+ public OperationContext newContext(final Executor executor)
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#clearContext()
+ */
+ public void clearContext()
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#setContext(org.hornetq.core.persistence.OperationContext)
+ */
+ public void setContext(final OperationContext context)
+ {
+ }
+
+ public void storeReference(final long queueID, final long messageID, final boolean
last) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#recoverAddressSettings()
+ */
+ public List<PersistedAddressSetting> recoverAddressSettings() throws
Exception
+ {
+ return Collections.emptyList();
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#recoverPersistedRoles()
+ */
+ public List<PersistedRoles> recoverPersistedRoles() throws Exception
+ {
+ return Collections.emptyList();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeAddressSetting(org.hornetq.core.persistconfig.PersistedAddressSetting)
+ */
+ public void storeAddressSetting(PersistedAddressSetting addressSetting) throws
Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeSecurityRoles(org.hornetq.core.persistconfig.PersistedRoles)
+ */
+ public void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#deleteAddressSetting(org.hornetq.api.core.SimpleString)
+ */
+ public void deleteAddressSetting(SimpleString addressMatch) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#deleteSecurityRoles(org.hornetq.api.core.SimpleString)
+ */
+ public void deleteSecurityRoles(SimpleString addressMatch) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deletePageTransactional(long)
+ */
+ public void deletePageTransactional(long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#updatePageTransaction(long,
org.hornetq.core.paging.PageTransactionInfo, int)
+ */
+ public void updatePageTransaction(long txID, PageTransactionInfo pageTransaction,
int depage) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storeCursorAcknowledge(long,
org.hornetq.core.paging.cursor.PagePosition)
+ */
+ public void storeCursorAcknowledge(long queueID, PagePosition position)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#storeCursorAcknowledgeTransactional(long,
long, org.hornetq.core.paging.cursor.PagePosition)
+ */
+ public void storeCursorAcknowledgeTransactional(long txID, long queueID,
PagePosition position)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#deleteCursorAcknowledgeTransactional(long,
long)
+ */
+ public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws
Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#updatePageTransaction(org.hornetq.core.paging.PageTransactionInfo,
int)
+ */
+ public void updatePageTransaction(PageTransactionInfo pageTransaction, int depage)
throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storePageCounter(long, long,
long)
+ */
+ public long storePageCounter(long txID, long queueID, long value) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deleteIncrementRecord(long,
long)
+ */
+ public void deleteIncrementRecord(long txID, long recordID) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#deletePageCounter(long, long)
+ */
+ public void deletePageCounter(long txID, long recordID) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storePageCounterInc(long, long,
int)
+ */
+ public long storePageCounterInc(long txID, long queueID, int add) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#storePageCounterInc(long, int)
+ */
+ public long storePageCounterInc(long queueID, int add) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#newSingleThreadContext()
+ */
+ public OperationContext newSingleThreadContext()
+ {
+ return getContext();
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#commit(long, boolean)
+ */
+ public void commit(long txID, boolean lineUpContext) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#lineUpContext()
+ */
+ public void lineUpContext()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#confirmPendingLargeMessageTX(org.hornetq.core.transaction.Transaction,
long, long)
+ */
+ public void confirmPendingLargeMessageTX(Transaction transaction, long messageID,
long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#confirmPendingLargeMessage(long)
+ */
+ public void confirmPendingLargeMessage(long recordID) throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#stop(boolean)
+ */
+ public void stop(boolean ioCriticalError) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#beforePageRead()
+ */
+ public void beforePageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#afterPageRead()
+ */
+ public void afterPageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#allocateDirectBuffer(int)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ return ByteBuffer.allocateDirect(size);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.hornetq.core.persistence.StorageManager#freeDirectuffer(java.nio.ByteBuffer)
+ */
+ public void freeDirectBuffer(ByteBuffer buffer)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
+>>>>>>> .merge-right.r12106
class FakeStoreFactory implements PagingStoreFactory
{