Package org.jboss.messaging.core.tx

Examples of org.jboss.messaging.core.tx.TransactionRepository


         connectionManager = new SimpleConnectionManager();
         connectorManager = new SimpleConnectorManager();
         memoryManager = new SimpleMemoryManager();
         messageStore = new SimpleMessageStore();
         txRepository =
            new TransactionRepository(persistenceManager, messageStore, transactionIDManager);
         messageCounterManager = new MessageCounterManager(queueStatsSamplePeriod);

         // Start the wired components

         messageIDManager.start();
View Full Code Here


      pm.start();
     
      ms = new SimpleMessageStore();
      ms.start();
     
      tr = new TransactionRepository(pm, ms, idm);

      tr.start();
        
      PagingFilteredQueue queue2 =
         new PagingFilteredQueue("queue1", 1, ms, pm, true, true,
View Full Code Here

      pm.start();
     
      ms = new SimpleMessageStore();
      ms.start();
     
      tr = new TransactionRepository(pm, ms, idm);
      tr.start();

      PagingFilteredQueue queue2 =
         new PagingFilteredQueue("queue1", 1, ms, pm, true, true,
                                 -1, null, 100, 20, 10);
View Full Code Here

        
         MessageStore ms = serverPeer.getMessageStore();
        
         PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
        
         TransactionRepository tr = serverPeer.getTxRepository();
        
         int nodeId = serverPeer.getServerPeerID();
        
         FilterFactory ff = new SelectorFactory();
        
View Full Code Here

      pm.start();
     
      IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
      idm.start();
     
      TransactionRepository tr = new TransactionRepository(pm, new SimpleMessageStore(), idm);
      tr.start();
     
      Transaction tx = tr.createTransaction();
     
      ((SimpleDelivery)delivery).acknowledge(tx);
     
      assertTrue(delivery.isDone());
     
      pm.stop();
      tr.stop();
     
      sc.stop();
   }
View Full Code Here

      {
         TransactionManager tm = getTransactionManagerReference();

         ServerPeer serverPeer = (ServerPeer)server.getAttribute(serverPeerObjectName, "Instance");
         MessageStore ms = serverPeer.getMessageStore();
         TransactionRepository tr = serverPeer.getTxRepository();
         PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
         int nodeId = serverPeer.getServerPeerID();

         Class clazz = Class.forName(messagePullPolicy);
         MessagePullPolicy pullPolicy = (MessagePullPolicy)clazz.newInstance();
View Full Code Here

      Channel channel = new SimpleChannel(0, ms);
     
      IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
      idm.start();
     
      TransactionRepository txRep = new TransactionRepository(pm, ms, idm);
      txRep.start();

      log.debug("transaction log started");

      Message[] messages = createMessages(10);
     
      Message m1 = messages[0];
      Message m2 = messages[1];
      Message m3 = messages[2];     
      Message m4 = messages[3];
      Message m5 = messages[4];

      Transaction tx = null;
      if (xa)
      {        
         tx = txRep.createTransaction(new MockXid());
      }
      else
      {
         tx = txRep.createTransaction();
      }
     
      if (xa)
      {
        assertEquals(1,txRep.getNumberOfRegisteredTransactions());
      }
      else
      {
        assertEquals(0,txRep.getNumberOfRegisteredTransactions());
      }
     
      MessageReference ref1 = ms.reference(m1);
      MessageReference ref2 = ms.reference(m2)
      MessageReference ref3 = ms.reference(m3);      
      MessageReference ref4 = ms.reference(m4);
      MessageReference ref5 = ms.reference(m5);

      log.debug("adding references non-transactionally");

      // Add first two refs non transactionally
      pm.addReference(channel.getChannelID(), ref1, null);
      pm.addReference(channel.getChannelID(), ref2, null);
     
      //check they're there
      List refs = getReferenceIds(channel.getChannelID());
      assertNotNull(refs);
      assertEquals(2, refs.size());
      assertTrue(refs.contains(new Long(ref1.getMessage().getMessageID())));
      assertTrue(refs.contains(new Long(ref2.getMessage().getMessageID())));
     
      List msgs = getMessageIds();
      assertNotNull(msgs);
      assertEquals(2, msgs.size());
      assertTrue(msgs.contains(new Long(ref1.getMessage().getMessageID())));
      assertTrue(msgs.contains(new Long(ref2.getMessage().getMessageID())));

      log.debug("ref1 and ref2 are there");

      //Add the next 3 refs transactionally
      pm.addReference(channel.getChannelID(), ref3, tx);
      pm.addReference(channel.getChannelID(), ref4, tx);
      pm.addReference(channel.getChannelID(), ref5, tx);
     
      //Remove the other 2 transactionally
      pm.removeReference(channel.getChannelID(), ref1, tx);
      pm.removeReference(channel.getChannelID(), ref2, tx);
     
      //Check the changes aren't visible
      refs = getReferenceIds(channel.getChannelID());
      assertNotNull(refs);
      assertEquals(2, refs.size());
      assertTrue(refs.contains(new Long(ref1.getMessage().getMessageID())));
      assertTrue(refs.contains(new Long(ref2.getMessage().getMessageID())))
     
      msgs = getMessageIds();
      assertNotNull(msgs);
      assertEquals(2, msgs.size());
      assertTrue(msgs.contains(new Long(ref1.getMessage().getMessageID())));
      assertTrue(msgs.contains(new Long(ref2.getMessage().getMessageID())));
     
      //commit transaction
      tx.commit();

      assertEquals("numberOfRegisteredTransactions",0,txRep.getNumberOfRegisteredTransactions());
     
      //check we can see only the last 3 refs
      refs = getReferenceIds(channel.getChannelID());
      assertNotNull(refs);
      assertEquals(3, refs.size());
View Full Code Here

      Channel channel = new SimpleChannel(0, ms);
     
      IDManager idm = new IDManager("TRANSACTION_ID", 10, pm);
      idm.start();
     
      TransactionRepository txRep = new TransactionRepository(pm, ms, idm);
      txRep.start();
      Message[] messages = createMessages(10);    
     
      Message m1 = messages[0];
      Message m2 = messages[1];
      Message m3 = messages[2];     
      Message m4 = messages[3];
      Message m5 = messages[4];

     
      Transaction tx = null;
      if (xa)
      {
         tx = txRep.createTransaction(new MockXid());
      }
      else
      {
         tx = txRep.createTransaction();
      }
     
      MessageReference ref1 = ms.reference(m1);
      MessageReference ref2 = ms.reference(m2)
      MessageReference ref3 = ms.reference(m3);      
View Full Code Here

      transactionIDManager.start();

      ms = new SimpleMessageStore();
      ms.start();

      tr = new TransactionRepository(pm, ms, transactionIDManager);
      tr.start();

      channelIDManager = new IDManager("CHANNEL_ID", 10, pm);
      channelIDManager.start();
View Full Code Here

      idm.start();
     
      ms = new SimpleMessageStore();
      ms.start();
     
      tr = new TransactionRepository(pm, ms, idm);
      tr.start();
     
   }
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.tx.TransactionRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.