Package org.apache.activemq.broker.region.policy

Examples of org.apache.activemq.broker.region.policy.PolicyEntry


    }

    @Override
    protected BrokerService createBroker() throws Exception {
        BrokerService broker = super.createBroker();
        PolicyEntry policy = new PolicyEntry();
        underTest.setAbortConnection(abortConnection);
        underTest.setCheckPeriod(checkPeriod);
        underTest.setMaxSlowDuration(maxSlowDuration);

        policy.setSlowConsumerStrategy(underTest);
        policy.setQueuePrefetch(10);
        policy.setTopicPrefetch(10);
        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);
        return broker;
    }
View Full Code Here


        broker.setBrokerName(getName(true));
        broker.setDeleteAllMessagesOnStartup(deleteAllMessages);
        broker.getManagementContext().setCreateConnector(false);

        if (usePrioritySupport) {
            PolicyEntry policy = new PolicyEntry();
            policy.setPrioritizedMessages(true);
            PolicyMap policyMap = new PolicyMap();
            policyMap.setDefaultEntry(policy);
            broker.setDestinationPolicy(policyMap);
        }
       
View Full Code Here

    protected void configureQueue(Queue queue, ActiveMQDestination destination) {
        if (broker == null) {
            throw new IllegalStateException("broker property is not set");
        }
        if (broker.getDestinationPolicy() != null) {
            PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
            if (entry != null) {
                entry.configure(broker,queue);
            }
        }
    }
View Full Code Here

    protected void configureTopic(Topic topic, ActiveMQDestination destination) {
        if (broker == null) {
            throw new IllegalStateException("broker property is not set");
        }
        if (broker.getDestinationPolicy() != null) {
            PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
            if (entry != null) {
                entry.configure(broker,topic);
            }
        }
    }
View Full Code Here

    protected void configureQueue(Queue queue, ActiveMQDestination destination) {
        if (broker == null) {
            throw new IllegalStateException("broker property is not set");
        }
        if (broker.getDestinationPolicy() != null) {
            PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
            if (entry != null) {
                entry.configure(broker,queue);
            }
        }
    }
View Full Code Here

        try {
            TopicSubscription answer = new TopicSubscription(broker, context, info, usageManager);
            // lets configure the subscription depending on the destination
            ActiveMQDestination destination = info.getDestination();
            if (destination != null && broker.getDestinationPolicy() != null) {
                PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
                if (entry != null) {
                    entry.configure(broker, usageManager, answer);
                }
            }
            answer.init();
            return answer;
        } catch (Exception e) {
View Full Code Here

        return new ConsumerId(recoveredDurableSubSessionId, recoveredDurableSubIdGenerator.getNextSequenceId());
    }

    protected void configureTopic(Topic topic, ActiveMQDestination destination) {
        if (broker.getDestinationPolicy() != null) {
            PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
            if (entry != null) {
                entry.configure(broker,topic);
            }
        }
    }
View Full Code Here

            if (sub == null) {
               
                sub = new DurableTopicSubscription(broker, usageManager, context, info, keepDurableSubsActive);

                if (destination != null && broker.getDestinationPolicy() != null) {
                    PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
                    if (entry != null) {
                        entry.configure(broker, usageManager, sub);
                    }
                }
                durableSubscriptions.put(key, sub);
            } else {
                throw new JMSException("That durable subscription is already active.");
            }
            return sub;
        }
        try {
            TopicSubscription answer = new TopicSubscription(broker, context, info, usageManager);
            // lets configure the subscription depending on the destination
            if (destination != null && broker.getDestinationPolicy() != null) {
                PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
                if (entry != null) {
                    entry.configure(broker, usageManager, answer);
                }
            }
            answer.init();
            return answer;
        } catch (Exception e) {
View Full Code Here

        bridgeBrokers("BrokerC", "BrokerA", dynamicOnly, networkTTL, conduitSubs);

        PolicyMap policyMap = new PolicyMap();
        // enable audit is on by default just need to give it matching policy entry
        // so it will be applied to the topic subscription
        policyMap.setDefaultEntry(new PolicyEntry());
        Collection<BrokerItem> brokerList = brokers.values();
        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
            BrokerService broker = i.next().broker;
            broker.setDestinationPolicy(policyMap);
            broker.setDeleteAllMessagesOnStartup(true);
View Full Code Here

    protected void configureQueue(Queue queue, ActiveMQDestination destination) {
        if (broker == null) {
            throw new IllegalStateException("broker property is not set");
        }
        if (broker.getDestinationPolicy() != null) {
            PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(destination);
            if (entry != null) {
                entry.configure(broker,queue);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.region.policy.PolicyEntry

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.