Package org.hornetq.jms.persistence.config

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


   {
      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

            HornetQServerLogger.LOGGER.info("Found JMS destination: " + destination.getName());
            jmsDestinations.put(new Pair<>(destination.getType(), destination.getName()), destination);
         }
         else if (rec == JMSJournalStorageManagerImpl.JNDI_RECORD)
         {
            PersistedJNDI jndi = new PersistedJNDI();
            jndi.decode(buffer);
            jndi.setId(id);
            Pair<PersistedType, String> key = new Pair<>(jndi.getType(), jndi.getName());
            StringBuilder builder = new StringBuilder();
            for (String binding : jndi.getJndi())
            {
               builder.append(binding).append(" ");
            }
            HornetQServerLogger.LOGGER.info("Found JMS JNDI binding data for " + jndi.getType() + " " + jndi.getName() + ": " + builder.toString());
            jmsJNDI.put(key, jndi);
         }
         else
         {
            throw new IllegalStateException("Invalid record type " + rec);
View Full Code Here

            xmlWriter.writeEndElement();
         }
         xmlWriter.writeEndElement();

         xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRIES);
         PersistedJNDI jndi = jmsJNDI.get(new Pair<>(PersistedType.ConnectionFactory, jmsConnectionFactory.getName()));
         for (String jndiEntry : jndi.getJndi())
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRY);
            xmlWriter.writeCharacters(jndiEntry);
            xmlWriter.writeEndElement();
         }
View Full Code Here

         xmlWriter.writeCharacters(jmsDestination.getType().toString());
         xmlWriter.writeEndElement();


         xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRIES);
         PersistedJNDI jndi = jmsJNDI.get(new Pair<>(jmsDestination.getType(), jmsDestination.getName()));
         for (String jndiEntry : jndi.getJndi())
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRY);
            xmlWriter.writeCharacters(jndiEntry);
            xmlWriter.writeEndElement();
         }
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

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.