[jboss-cvs] JBoss Messaging SVN: r1643 - branches/Branch_1_0_XARecovery/src/main/org/jboss/messaging/core/tx
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 27 07:44:14 EST 2006
Author: juha at jboss.org
Date: 2006-11-27 07:44:12 -0500 (Mon, 27 Nov 2006)
New Revision: 1643
Modified:
branches/Branch_1_0_XARecovery/src/main/org/jboss/messaging/core/tx/TransactionRepository.java
Log:
transaction repositry start() is fitted with a reference to the configured message store implementation (JBMESSAGING-650)
Modified: branches/Branch_1_0_XARecovery/src/main/org/jboss/messaging/core/tx/TransactionRepository.java
===================================================================
--- branches/Branch_1_0_XARecovery/src/main/org/jboss/messaging/core/tx/TransactionRepository.java 2006-11-27 12:42:24 UTC (rev 1642)
+++ branches/Branch_1_0_XARecovery/src/main/org/jboss/messaging/core/tx/TransactionRepository.java 2006-11-27 12:44:12 UTC (rev 1643)
@@ -25,23 +25,21 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-
import javax.transaction.xa.Xid;
+import org.jboss.jms.destination.JBossDestination;
+import org.jboss.jms.server.plugin.JDBCChannelMapper;
+import org.jboss.jms.server.plugin.contract.ChannelMapper;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdManager;
-import org.jboss.messaging.core.plugin.SimpleMessageStore;
-import org.jboss.messaging.core.plugin.contract.PersistenceManager;
-import org.jboss.messaging.core.plugin.contract.MessageStore;
-import org.jboss.messaging.core.MessageReference;
-import org.jboss.messaging.core.Message;
-import org.jboss.messaging.core.SimpleDelivery;
import org.jboss.messaging.core.Delivery;
import org.jboss.messaging.core.DeliveryObserver;
+import org.jboss.messaging.core.Message;
+import org.jboss.messaging.core.MessageReference;
+import org.jboss.messaging.core.SimpleDelivery;
import org.jboss.messaging.core.local.CoreDestination;
-import org.jboss.jms.server.plugin.contract.ChannelMapper;
-import org.jboss.jms.server.plugin.JDBCChannelMapper;
-import org.jboss.jms.destination.JBossDestination;
+import org.jboss.messaging.core.plugin.IdManager;
+import org.jboss.messaging.core.plugin.contract.MessageStore;
+import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
@@ -70,7 +68,9 @@
protected Map globalToLocalMap;
protected PersistenceManager persistenceManager;
-
+
+ protected MessageStore messageStore;
+
protected IdManager idManager;
// Static --------------------------------------------------------
@@ -84,10 +84,11 @@
// Public --------------------------------------------------------
- public void start(PersistenceManager persistenceManager) throws Exception
+ public void start(PersistenceManager persistenceManager, MessageStore store) throws Exception
{
this.persistenceManager = persistenceManager;
-
+ this.messageStore = store;
+
//TODO make this configurable
idManager = new IdManager("TRANSACTION_ID", 4096, persistenceManager);
}
@@ -231,19 +232,6 @@
}
- // TODO: [JPL] BEGIN REMOVE ------------------------------------------------
-
- // [JPL] this is a wrong way of getting to the store, it ignores the
- // configuration settings and needs to be retrieved via the kernel
-
- public MessageStore getMessageStore()
- {
- return new SimpleMessageStore("store.0");
- }
-
- // TODO: [JPL] END REMOVE --------------------------------------------------
-
-
/** To be used only by testcases */
public int getNumberOfRegisteredTransactions()
{
@@ -313,12 +301,8 @@
List noRefsList = new ArrayList();
List refsList = new ArrayList();
- // Find the message store
- // TODO: [JPL] this needs to be fixed to go through the kernel
- MessageStore ms = getMessageStore();
-
// and message reference from store
- MessageReference ref = ms.reference(messageId);
+ MessageReference ref = messageStore.reference(messageId);
// Store, sometime, does'nt know about the message referece
// and the above ref may be null. Hence we need to load actual message
@@ -339,7 +323,7 @@
for (Iterator iter = messagesList.iterator(); iter.hasNext();)
{
Message m = (Message) iter.next();
- MessageReference r = ms.reference(m);
+ MessageReference r = messageStore.reference(m);
refsList.add(r);
}
More information about the jboss-cvs-commits
mailing list