Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Values


     * @param broker
     */
    public BrokerContainerImpl(Broker broker, BrokerContext context) {
        this.broker = broker;
        this.context = context;
        this.clientIds = new ConcurrentHashMap();
        this.consumerInfos = new ConcurrentHashMap();
        this.producerInfos = new ConcurrentHashMap();
        this.transportConnectors = new CopyOnWriteArrayList();
        this.networkConnectors = new CopyOnWriteArrayList();
        this.broker.addCapacityEventListener(this);

        // lets register ourselves with the context
View Full Code Here


    private Map subscriptions;
    private DestinationMap destinationIndex = new DestinationMap();
    private RedeliveryPolicy redeliveryPolicy;

    public SubscriptionContainerImpl(RedeliveryPolicy redeliveryPolicy) {
        this(new ConcurrentHashMap(), redeliveryPolicy);
    }
View Full Code Here

    private String queuePrefix = "queue.";
    private String topicPrefix = "topic.";

    public Context getInitialContext(Hashtable environment) throws NamingException {
        // lets create a factory
        Map data = new ConcurrentHashMap();
        ActiveMQConnectionFactory factory = createConnectionFactory(environment);
        data.put("ConnectionFactory", factory);
        data.put("QueueConnectionFactory", factory);
        data.put("TopicConnectionFactory", factory);

        createQueues(data, environment);
        createTopics(data, environment);

        try {
            Broker broker = factory.getEmbeddedBroker();
            if (broker != null) {
                data.put("destinations", broker.getDestinationContext(environment));
            }
        }
        catch (JMSException e) {
            CommunicationException exception = new CommunicationException("Failed to access embedded broker: " + e);
            exception.setRootCause(e);
View Full Code Here

    public DefaultBroker(String brokerName, String brokerClusterName) {
        this.brokerName = brokerName;
        this.brokerClusterName = brokerClusterName;
        memoryManager = new MemoryBoundedQueueManager("Broker Memory Manager", DEFAULT_MAX_MEMORY_USAGE);
        setDelegate(memoryManager);
        containerManagerMap = new ConcurrentHashMap();
        consumerInfoListeners = new CopyOnWriteArrayList();
    }
View Full Code Here

        this.memoryManager.setValueLimit(maximumMemoryUsage);
    }


    public Context getDestinationContext(Hashtable environment) {
        Map data = new ConcurrentHashMap();
        for (Iterator iter = containerManagerMap.entrySet().iterator(); iter.hasNext();) {
            Map.Entry entry = (Map.Entry) iter.next();
            String name = entry.getKey().toString();
            MessageContainerManager manager = (MessageContainerManager) entry.getValue();
            Context context = new ReadOnlyContext(environment, manager.getDestinations());
            data.put(name, context);
        }
        return new ReadOnlyContext(environment, data);
    }
View Full Code Here

     *
     * @param mgr
     */
    public TransientQueueBoundedMessageManager(MemoryBoundedQueueManager mgr) {
        this.queueManager = mgr;
        this.containers = new ConcurrentHashMap();
        this.destinationMap = new DestinationMap();
        this.destinations = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
        this.doingGarbageCollection = new SynchronizedBoolean(false);
    }
View Full Code Here

    /**
     * Default Constructor
     */
    public NetworkChannel() {
        this.consumerMap = new ConcurrentHashMap();
    }
View Full Code Here

     *
     * @param mgr
     */
    public TransientTopicBoundedMessageManager(MemoryBoundedQueueManager mgr) {
        this.queueManager = mgr;
        this.containers = new ConcurrentHashMap();
        this.destinationMap = new DestinationMap();
        this.destinations = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
    }
View Full Code Here

    private String queuePrefix = "queue.";
    private String topicPrefix = "topic.";

    public Context getInitialContext(Hashtable environment) throws NamingException {
        // lets create a factory
        Map data = new ConcurrentHashMap();
        Broker broker = null;
       
        String[] names = getConnectionFactoryNames(environment);
        for (int i = 0; i < names.length; i++) {
           
            String name = names[i];
            ActiveMQConnectionFactory factory = createConnectionFactory(name, environment);
           
            if( broker==null ) {
                try {
                    broker = factory.getEmbeddedBroker();
                }
                catch (JMSException ignore) {
                }
            }
            data.put(name,factory);
        }
               
        createQueues(data, environment);
        createTopics(data, environment);
        if (broker != null) {
            data.put("destinations", broker.getDestinationContext(environment));
        }
       
        return new ReadOnlyContext(environment, data);
    }
View Full Code Here

    /**
     * Default constructor
     *
     */
    public NetworkChannel(){
        this.consumerMap = new ConcurrentHashMap();
    }
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Values

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.