Package org.apache.tuscany.sca.binding.notification.encoding

Examples of org.apache.tuscany.sca.binding.notification.encoding.Broker


            } else if (eo instanceof ReplaceBrokerConnection) {
                ReplaceBrokerConnection rbc = (ReplaceBrokerConnection)eo;
                URL removedBrokerConsumerEpr = rbc.getRemovedBroker().getReference().getEndpointAddress().getAddress();
                if (rbc.getNeighbors() != null) {
                    int choice = rbc.getNeighbors().getBrokerSequence().size() - 1;
                    Broker chosenBroker = rbc.getNeighbors().getBrokerSequence().get(choice);
                    replaceBrokerSubscriber(removedBrokerConsumerEpr,
                                                    chosenBroker.getBrokerConsumerReference().getReference());
                    brokerManager.replaceConsumersBrokerConnection(notificationType,
                                                                   chosenBroker.getBrokerProducerReference().getReference());
                } else {
                    replaceBrokerSubscriber(removedBrokerConsumerEpr, null);
                }
            } else {
                throw new RuntimeException("Unknown encoding object");
View Full Code Here


                    nbr.setEndProducers(endProducers);
                } else {
                    nbr.setFirstBroker(false);
                    Brokers brokers = new Brokers();
                    for (BrokerStruct brokerStruct : brokerList) {
                        Broker brokerElt = new Broker();
                        BrokerConsumerReference bcr = new BrokerConsumerReference();
                        bcr.setReference(EncodingUtils.createEndpointReference(brokerStruct.consumerUrl, brokerStruct.brokerID));
                        brokerElt.setBrokerConsumerReference(bcr);
                           
                        BrokerProducerReference bpr = new BrokerProducerReference();
                        bpr.setReference(EncodingUtils.createEndpointReference(brokerStruct.producerUrl, brokerStruct.brokerID));
                        brokerElt.setBrokerProducerReference(bpr);
                        brokers.addBrokerToSequence(brokerElt);
                    }
                    nbr.setBrokers(brokers);
                }
                EndpointReference consumerEPR = nb.getBrokerConsumerReference().getReference();
View Full Code Here

                        }
                        BrokerConsumerReference bcr = new BrokerConsumerReference();
                        bcr.setReference(EncodingUtils.createEndpointReference(neighborBrokerStruct.consumerUrl, neighborBrokerStruct.brokerID));
                        BrokerProducerReference bpr = new BrokerProducerReference();
                        bpr.setReference(EncodingUtils.createEndpointReference(neighborBrokerStruct.producerUrl, neighborBrokerStruct.brokerID));
                        Broker neighborBroker = new Broker();
                        neighborBroker.setBrokerConsumerReference(bcr);
                        neighborBroker.setBrokerProducerReference(bpr);
                        neighborBrokers.add(neighborBroker);
                    }
                    int lastIndex = neighborBrokers.size() - 1;
                    for (int index = lastIndex; index >= 0; index--) {
                        List<Broker> writeableNeighborBrokers = ((index > 0) ? neighborBrokers.subList(0, index) : null);
View Full Code Here

            else if (eo instanceof ReplaceBrokerConnection) {
                ReplaceBrokerConnection rbc = (ReplaceBrokerConnection)eo;
                URL removedBrokerConsumerEpr = rbc.getRemovedBroker().getReference().getEndpointAddress().getAddress();
                if (rbc.getNeighbors() != null) {
                    int choice = rbc.getNeighbors().getBrokerSequence().size() - 1;
                    Broker chosenBroker = rbc.getNeighbors().getBrokerSequence().get(choice);
                    invoker.replaceBrokerSubscriber(removedBrokerConsumerEpr,
                                                    chosenBroker.getBrokerConsumerReference().getReference());
                    brokerManager.replaceConsumersBrokerConnection(notificationType,
                                                                   chosenBroker.getBrokerProducerReference().getReference());
                }
                else {
                    invoker.replaceBrokerSubscriber(removedBrokerConsumerEpr, null);
                }
            }
View Full Code Here

            else if (eo instanceof ReplaceBrokerConnection) {
                ReplaceBrokerConnection rbc = (ReplaceBrokerConnection)eo;
                URL removedBrokerConsumerEpr = rbc.getRemovedBroker().getReference().getEndpointAddress().getAddress();
                if (rbc.getNeighbors() != null) {
                    int choice = rbc.getNeighbors().getBrokerSequence().size() - 1;
                    Broker chosenBroker = rbc.getNeighbors().getBrokerSequence().get(choice);
                    replaceBrokerSubscriber(removedBrokerConsumerEpr,
                                                    chosenBroker.getBrokerConsumerReference().getReference());
                    brokerManager.replaceConsumersBrokerConnection(notificationType,
                                                                   chosenBroker.getBrokerProducerReference().getReference());
                }
                else {
                    replaceBrokerSubscriber(removedBrokerConsumerEpr, null);
                }
            }
View Full Code Here

                }
                else {
                    nbr.setFirstBroker(false);
                    Brokers brokers = new Brokers();
                    for (BrokerStruct brokerStruct : brokerList) {
                        Broker brokerElt = new Broker();
                        BrokerConsumerReference bcr = new BrokerConsumerReference();
                        bcr.setReference(EncodingUtils.createEndpointReference(brokerStruct.consumerUrl, brokerStruct.brokerID));
                        brokerElt.setBrokerConsumerReference(bcr);
                           
                        BrokerProducerReference bpr = new BrokerProducerReference();
                        bpr.setReference(EncodingUtils.createEndpointReference(brokerStruct.producerUrl, brokerStruct.brokerID));
                        brokerElt.setBrokerProducerReference(bpr);
                        brokers.addBrokerToSequence(brokerElt);
                    }
                    nbr.setBrokers(brokers);
                }
                EndpointReference consumerEPR = nb.getBrokerConsumerReference().getReference();
View Full Code Here

                        }
                        BrokerConsumerReference bcr = new BrokerConsumerReference();
                        bcr.setReference(EncodingUtils.createEndpointReference(neighborBrokerStruct.consumerUrl, neighborBrokerStruct.brokerID));
                        BrokerProducerReference bpr = new BrokerProducerReference();
                        bpr.setReference(EncodingUtils.createEndpointReference(neighborBrokerStruct.producerUrl, neighborBrokerStruct.brokerID));
                        Broker neighborBroker = new Broker();
                        neighborBroker.setBrokerConsumerReference(bcr);
                        neighborBroker.setBrokerProducerReference(bpr);
                        neighborBrokers.add(neighborBroker);
                    }
                    int lastIndex = neighborBrokers.size() - 1;
                    for (int index = lastIndex; index >= 0; index--) {
                        List<Broker> writeableNeighborBrokers = ((index > 0) ? neighborBrokers.subList(0, index) : null);
View Full Code Here

            else if (eo instanceof ReplaceBrokerConnection) {
                ReplaceBrokerConnection rbc = (ReplaceBrokerConnection)eo;
                URL removedBrokerConsumerEpr = rbc.getRemovedBroker().getReference().getEndpointAddress().getAddress();
                if (rbc.getNeighbors() != null) {
                    int choice = rbc.getNeighbors().getBrokerSequence().size() - 1;
                    Broker chosenBroker = rbc.getNeighbors().getBrokerSequence().get(choice);
                    replaceBrokerSubscriber(removedBrokerConsumerEpr,
                                                    chosenBroker.getBrokerConsumerReference().getReference());
                    brokerManager.replaceConsumersBrokerConnection(notificationType,
                                                                   chosenBroker.getBrokerProducerReference().getReference());
                }
                else {
                    replaceBrokerSubscriber(removedBrokerConsumerEpr, null);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.notification.encoding.Broker

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.