Package org.apache.qpid.server.binding

Examples of org.apache.qpid.server.binding.Binding


        }
    }

    public boolean isBound(String bindingKey, Map<String, Object> arguments, AMQQueue queue)
    {
        Binding binding = new Binding(null, null, bindingKey, queue, this, arguments);
        if (arguments == null)
        {
            return _bindings.containsKey(binding);
        }
        else
View Full Code Here


        try
        {
            if(!virtualHost.getBindingFactory().addBinding(bindingKey, amqQueue, _exchange, bindingArguments))
            {
                Binding oldBinding = virtualHost.getBindingFactory().getBinding(bindingKey, amqQueue, _exchange,
                                                                                bindingArguments);

                Map<String, Object> oldArgs = oldBinding.getArguments();
                if((oldArgs == null && !bindingArguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(bindingArguments)))
                {
                    virtualHost.getBindingFactory().replaceBinding(oldBinding.getId(), bindingKey, amqQueue, _exchange, bindingArguments);
                }
            }
            Binding binding = virtualHost.getBindingFactory().getBinding(bindingKey, amqQueue, _exchange, bindingArguments);

            synchronized (_bindingAdapters)
            {
                return binding == null ? null : _bindingAdapters.get(binding);
            }
View Full Code Here

        try
        {
            if(!_exchange.addBinding(bindingKey, amqQueue, bindingArguments))
            {
                Binding oldBinding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);

                Map<String, Object> oldArgs = oldBinding.getArguments();
                if((oldArgs == null && !bindingArguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(bindingArguments)))
                {
                    _exchange.replaceBinding(oldBinding.getId(), bindingKey, amqQueue, bindingArguments);
                }
            }
            Binding binding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);

            synchronized (_bindingAdapters)
            {
                return binding == null ? null : _bindingAdapters.get(binding);
            }
View Full Code Here

    {
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");
        matchHeaders.setString("B", "Value of B");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

    {
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Altered value of A");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertFalse(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("X-match", "all");
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("A", "Value of A");
        bindHeaders.put("B", "Value of B");

        matchHeaders.setString("A", "Value of A");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertFalse(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("B", "Value of B");

        matchHeaders.setString("A", "Value of A");
        matchHeaders.setString("B", "Value of B");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        matchHeaders.setString("A", "Value of A");
        matchHeaders.setString("B", "Value of B");
        matchHeaders.setString("C", "Value of C");

        Binding b = new Binding(null, null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.binding.Binding

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.