Package org.hornetq.core.settings.impl

Examples of org.hornetq.core.settings.impl.AddressSettings


      this.securityManager = securityManager;

      addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>();

      addressSettingsRepository.setDefault(new AddressSettings());

      securityRepository = new HierarchicalObjectRepository<Set<Role>>();

      securityRepository.setDefault(new HashSet<Role>());
View Full Code Here


      if (!internalQueue && message.isDurable() && durable && !reference.isPaged())
      {
         storageManager.updateDeliveryCount(reference);
      }

      AddressSettings addressSettings = addressSettingsRepository.getMatch(address.toString());

      int maxDeliveries = addressSettings.getMaxDeliveryAttempts();
      long redeliveryDelay = addressSettings.getRedeliveryDelay();
      int deliveryCount = reference.getDeliveryCount();

      // First check DLA
      if (maxDeliveries > 0 && deliveryCount >= maxDeliveries)
      {
         if (isTrace)
         {
            HornetQServerLogger.LOGGER.trace("Sending reference " + reference + " to DLA = " + addressSettings.getDeadLetterAddress() " since ref.getDeliveryCount=" + reference.getDeliveryCount() + "and maxDeliveries=" + maxDeliveries + " from queue=" + this.getName());
         }
         sendToDeadLetterAddress(reference, addressSettings.getDeadLetterAddress());

         return false;
      }
      else
      {
View Full Code Here

      }

      if (config.getForwardingAddress() != null)
      {
         AddressSettings addressConfig = configuration.getAddressesSettings().get(config.getForwardingAddress());

         // The address config could be null on certain test cases or some Embedded environment
         if (addressConfig == null)
         {
            // We will certainly have this warning on testcases which is ok
            HornetQServerLogger.LOGGER.bridgeCantFindAddressConfig(config.getName(), config.getForwardingAddress());
         }
         else
         {
            final int windowSize = config.getConfirmationWindowSize();
            final long maxBytes = addressConfig.getMaxSizeBytes();

            if (maxBytes !=-1 && maxBytes < windowSize)
            {
               HornetQServerLogger.LOGGER.bridgeConfirmationWindowTooSmall(config.getName(),
                                                                           config.getForwardingAddress(), windowSize,
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         if (addressSettings != null && addressSettings.getDeadLetterAddress() != null)
         {
            return addressSettings.getDeadLetterAddress().toString();
         }
         return null;
      }
      finally
      {
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         if (deadLetterAddress != null)
         {
            addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
         }
      }
      finally
      {
         blockOnIO();
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         if (addressSettings != null && addressSettings.getExpiryAddress() != null)
         {
            return addressSettings.getExpiryAddress().toString();
         }
         else
         {
            return null;
         }
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         SimpleString sExpiryAddress = new SimpleString(expiryAddress);

         if (expiryAddress != null)
         {
            addressSettings.setExpiryAddress(sExpiryAddress);
         }

         queue.setExpiryAddress(sExpiryAddress);
      }
      finally
View Full Code Here

   {
      String match = getAttributeValue(node, "match");

      NodeList children = node.getChildNodes();

      AddressSettings addressSettings = new AddressSettings();

      Pair<String, AddressSettings> setting = new Pair<String, AddressSettings>(match, addressSettings);

      for (int i = 0; i < children.getLength(); i++)
      {
         final Node child = children.item(i);
         final String name = child.getNodeName();
         if (DEAD_LETTER_ADDRESS_NODE_NAME.equalsIgnoreCase(name))
         {
            SimpleString queueName = new SimpleString(getTrimmedTextContent(child));
            addressSettings.setDeadLetterAddress(queueName);
         }
         else if (EXPIRY_ADDRESS_NODE_NAME.equalsIgnoreCase(name))
         {
            SimpleString queueName = new SimpleString(getTrimmedTextContent(child));
            addressSettings.setExpiryAddress(queueName);
         }
         else if (EXPIRY_DELAY_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setExpiryDelay(XMLUtil.parseLong(child));
         }
         else if (REDELIVERY_DELAY_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setRedeliveryDelay(XMLUtil.parseLong(child));
         }
         else if (REDELIVERY_DELAY_MULTIPLIER_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setRedeliveryMultiplier(XMLUtil.parseDouble(child));
         }
         else if (MAX_REDELIVERY_DELAY_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setMaxRedeliveryDelay(XMLUtil.parseLong(child));
         }
         else if (MAX_SIZE_BYTES_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setMaxSizeBytes(XMLUtil.parseLong(child));
         }
         else if (PAGE_SIZE_BYTES_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setPageSizeBytes(XMLUtil.parseLong(child));
         }
         else if (PAGE_MAX_CACHE_SIZE_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setPageCacheMaxSize(XMLUtil.parseInt(child));
         }
         else if (MESSAGE_COUNTER_HISTORY_DAY_LIMIT_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setMessageCounterHistoryDayLimit(XMLUtil.parseInt(child));
         }
         else if (ADDRESS_FULL_MESSAGE_POLICY_NODE_NAME.equalsIgnoreCase(name))
         {
            String value = getTrimmedTextContent(child);
            Validators.ADDRESS_FULL_MESSAGE_POLICY_TYPE.validate(ADDRESS_FULL_MESSAGE_POLICY_NODE_NAME,
                                                                 value);
            AddressFullMessagePolicy policy = Enum.valueOf(AddressFullMessagePolicy.class, value);
            addressSettings.setAddressFullMessagePolicy(policy);
         }
         else if (LVQ_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setLastValueQueue(XMLUtil.parseBoolean(child));
         }
         else if (MAX_DELIVERY_ATTEMPTS.equalsIgnoreCase(name))
         {
            addressSettings.setMaxDeliveryAttempts(XMLUtil.parseInt(child));
         }
         else if (REDISTRIBUTION_DELAY_NODE_NAME.equalsIgnoreCase(name))
         {
            addressSettings.setRedistributionDelay(XMLUtil.parseLong(child));
         }
         else if (SEND_TO_DLA_ON_NO_ROUTE.equalsIgnoreCase(name))
         {
            addressSettings.setSendToDLAOnNoRoute(XMLUtil.parseBoolean(child));
         }
      }
      return setting;
   }
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         if (addressSettings != null && addressSettings.getDeadLetterAddress() != null)
         {
            return addressSettings.getDeadLetterAddress().toString();
         }
         return null;
      }
      finally
      {
View Full Code Here

      checkStarted();

      clearIO();
      try
      {
         AddressSettings addressSettings = addressSettingsRepository.getMatch(address);

         if (deadLetterAddress != null)
         {
            addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
         }
      }
      finally
      {
         blockOnIO();
View Full Code Here

TOP

Related Classes of org.hornetq.core.settings.impl.AddressSettings

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.