Package org.hornetq.core.postoffice

Examples of org.hornetq.core.postoffice.Address


      return nameMap;
   }

   public Bindings getMatchingBindings(final SimpleString address) throws Exception
   {
      Address add = new AddressImpl(address);

      Bindings bindings = bindingsFactory.createBindings(address);

      for (Binding binding : nameMap.values())
      {
         Address addCheck = new AddressImpl(binding.getAddress());

         if (addCheck.matches(add))
         {
            bindings.addBinding(binding);
         }
      }
View Full Code Here


      return nameMap;
   }

   public Bindings getMatchingBindings(final SimpleString address) throws Exception
   {
      Address add = new AddressImpl(address);

      Bindings bindings = bindingsFactory.createBindings(address);

      for (Binding binding : nameMap.values())
      {
         Address addCheck = new AddressImpl(binding.getAddress());

         if (addCheck.matches(add))
         {
            bindings.addBinding(binding);
         }
      }
View Full Code Here

      Bindings bindings = super.getBindingsForRoutingAddress(address);

      // this should only happen if we're routing to an address that has no mappings when we're running checkAllowable
      if (bindings == null && !wildCardAddresses.isEmpty())
      {
         Address add = addAndUpdateAddressMap(address);
         if (!add.containsWildCard())
         {
            for (Address destAdd : add.getLinkedAddresses())
            {
               Bindings b = super.getBindingsForRoutingAddress(destAdd.getAddress());
               if (b != null)
               {
                  Collection<Binding> theBindings = b.getBindings();
View Full Code Here

   public boolean addBinding(final Binding binding) throws Exception
   {
      boolean exists = super.addBinding(binding);
      if (!exists)
      {
         Address add = addAndUpdateAddressMap(binding.getAddress());
         if (add.containsWildCard())
         {
            for (Address destAdd : add.getLinkedAddresses())
            {
               super.addMappingInternal(destAdd.getAddress(), binding);
            }
         }
         else
         {
            for (Address destAdd : add.getLinkedAddresses())
            {
               Bindings bindings = super.getBindingsForRoutingAddress(destAdd.getAddress());
               for (Binding b : bindings.getBindings())
               {
                  super.addMappingInternal(binding.getAddress(), b);
View Full Code Here

   public Binding removeBinding(final SimpleString uniqueName) throws Exception
   {
      Binding binding = super.removeBinding(uniqueName);
      if (binding != null)
      {
         Address add = getAddress(binding.getAddress());
         if (!add.containsWildCard())
         {
            for (Address theAddress : add.getLinkedAddresses())
            {
               Bindings bindings = super.getBindingsForRoutingAddress(theAddress.getAddress());
               if (bindings != null)
               {
                  for (Binding b : bindings.getBindings())
                  {
                     super.removeBindingInternal(binding.getAddress(), b.getUniqueName());
                  }
               }
            }
         }
         else
         {
            for (Address theAddress : add.getLinkedAddresses())
            {
               super.removeBindingInternal(theAddress.getAddress(), uniqueName);
            }
         }
         removeAndUpdateAddressMap(add);
View Full Code Here

      wildCardAddresses.clear();
   }

   private Address getAddress(final SimpleString address)
   {
      Address add = new AddressImpl(address);
      Address actualAddress;
      if (add.containsWildCard())
      {
         actualAddress = wildCardAddresses.get(address);
      }
      else
View Full Code Here

      return actualAddress != null ? actualAddress : add;
   }

   private synchronized Address addAndUpdateAddressMap(final SimpleString address)
   {
      Address add = new AddressImpl(address);
      Address actualAddress;
      if (add.containsWildCard())
      {
         actualAddress = wildCardAddresses.get(address);
      }
      else
      {
         actualAddress = addresses.get(address);
      }
      if (actualAddress == null)
      {
         actualAddress = add;
         addAddress(address, actualAddress);
      }
      if (actualAddress.containsWildCard())
      {
         for (Address destAdd : addresses.values())
         {
            if (destAdd.matches(actualAddress))
            {
               destAdd.addLinkedAddress(actualAddress);
               actualAddress.addLinkedAddress(destAdd);
            }
         }
      }
      else
      {
         for (Address destAdd : wildCardAddresses.values())
         {
            if (actualAddress.matches(destAdd))
            {
               destAdd.addLinkedAddress(actualAddress);
               actualAddress.addLinkedAddress(destAdd);

            }
         }
      }
      return actualAddress;
View Full Code Here

      return nameMap;
   }

   public Bindings getMatchingBindings(final SimpleString address) throws Exception
   {
      Address add = new AddressImpl(address);

      Bindings bindings = bindingsFactory.createBindings(address);

      for (Binding binding : nameMap.values())
      {
         Address addCheck = new AddressImpl(binding.getAddress());

         if (addCheck.matches(add))
         {
            bindings.addBinding(binding);
         }
      }
View Full Code Here

{
   public void testNoDots()
   {
      SimpleString s1 = new SimpleString("abcde");
      SimpleString s2 = new SimpleString("abcde");
      Address a1 = new AddressImpl(s1);
      Address a2 = new AddressImpl(s2);
      Assert.assertTrue(a1.matches(a2));
   }
View Full Code Here

   public void testDotsSameLength2()
   {
      SimpleString s1 = new SimpleString("a.b");
      SimpleString s2 = new SimpleString("a.b");
      Address a1 = new AddressImpl(s1);
      Address a2 = new AddressImpl(s2);
      Assert.assertTrue(a1.matches(a2));
   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.postoffice.Address

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.