Package org.hornetq.jms.persistence.config

Examples of org.hornetq.jms.persistence.config.PersistedJNDI


            destination.setId(id);
            destinations.put(new Pair<PersistedType, String>(destination.getType(), destination.getName()), destination);
         }
         else if (rec == JNDI_RECORD)
         {
            PersistedJNDI jndi = new PersistedJNDI();
            jndi.decode(buffer);
            jndi.setId(id);
            Pair<PersistedType, String> key = new Pair<PersistedType, String>(jndi.getType(), jndi.getName());
            mapJNDI.put(key, jndi);
         }
         else
         {
            throw new IllegalStateException("Invalid record type " + rec);
View Full Code Here


      jndiList = jmsJournal.recoverPersistedJNDI();

      assertEquals(1, jndiList.size());

      PersistedJNDI jndi = jndiList.get(0);

      List<String> jndis = jndi.getJndi();

      assertEquals(1, jndis.size());

      assertEquals("jndi-1", jndis.get(0));
View Full Code Here

   {
      Pair<PersistedType, String> key = new Pair<PersistedType, String>(type, name);

      long tx = idGenerator.generateID();
     
      PersistedJNDI currentJNDI = mapJNDI.get(key);
      if (currentJNDI != null)
      {
         jmsJournal.appendDeleteRecordTransactional(tx, currentJNDI.getId());
      }
      else
      {
         currentJNDI = new PersistedJNDI(type, name);
      }
     
      mapJNDI.put(key, currentJNDI);
     
      for (String adItem : address)
      {
         currentJNDI.addJNDI(adItem);
      }
     

      long newId = idGenerator.generateID();
     
      currentJNDI.setId(newId);
     
      jmsJournal.appendAddRecordTransactional(tx, newId, JNDI_RECORD, currentJNDI);
     
      jmsJournal.appendCommitRecord(tx, true);
   }
View Full Code Here

   {
      Pair<PersistedType, String> key = new Pair<PersistedType, String>(type, name);

      long tx = idGenerator.generateID();
     
      PersistedJNDI currentJNDI = mapJNDI.get(key);
      if (currentJNDI == null)
      {
         return;
      }
      else
      {
         jmsJournal.appendDeleteRecordTransactional(tx, currentJNDI.getId());
      }
     
      currentJNDI.deleteJNDI(address);
     
      if (currentJNDI.getJndi().size() == 0)
      {
         mapJNDI.remove(key);
      }
      else
      {
         long newId = idGenerator.generateID();
         currentJNDI.setId(newId);
         jmsJournal.appendAddRecordTransactional(tx, newId, JNDI_RECORD, currentJNDI);
      }
     
      jmsJournal.appendCommitRecord(tx, true);
   }
View Full Code Here

  
   public void deleteJNDI(PersistedType type, String name) throws Exception
   {
      Pair<PersistedType, String> key = new Pair<PersistedType, String>(type, name);
     
      PersistedJNDI currentJNDI = mapJNDI.remove(key);

      if (currentJNDI != null)
      {
         jmsJournal.appendDeleteRecord(currentJNDI.getId(), true);
      }
   }
View Full Code Here

            destination.setId(id);
            destinations.put(new Pair<PersistedType, String>(destination.getType(), destination.getName()), destination);
         }
         else if (rec == JNDI_RECORD)
         {
            PersistedJNDI jndi = new PersistedJNDI();
            jndi.decode(buffer);
            jndi.setId(id);
            Pair<PersistedType, String> key = new Pair<PersistedType, String>(jndi.getType(), jndi.getName());
            mapJNDI.put(key, jndi);
         }
         else
         {
            throw new IllegalStateException("Invalid record type " + rec);
View Full Code Here

TOP

Related Classes of org.hornetq.jms.persistence.config.PersistedJNDI

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.