Package org.exolab.jms.messagemgr

Examples of org.exolab.jms.messagemgr.ConsumerEndpoint


        if (queue == null) {
            throw new JMSException("Cannot create QueueBrowser for null queue");
        }

        ConsumerEndpoint consumer = _consumerMgr.createQueueBrowser(queue,
                                                                    selector);

        _consumer.addConsumer(consumer);
        return consumer.getId();
    }
View Full Code Here


            _log.debug("removeConsumer(consumerId=" + consumerId
                       + ") [session="
                       + this + "]");
        }

        ConsumerEndpoint consumer = _consumer.removeConsumer(consumerId);
        _consumerMgr.closeConsumer(consumer);
    }
View Full Code Here

            }

            _consumer.stop();
            ConsumerEndpoint[] consumers = _consumer.getConsumers();
            for (int i = 0; i < consumers.length; ++i) {
                ConsumerEndpoint consumer = consumers[i];
                _consumer.removeConsumer(consumer.getId());
                _consumerMgr.closeConsumer(consumer);
            }

            _consumer.close();
View Full Code Here

    public int getDurableConsumerMessageCount(String topic, String name) {
        int count = -1;
        try {
            // first see if the cache is loaded in memory
            JmsDestination dest = _destinations.getDestination(topic);
            ConsumerEndpoint endpoint = null;
            if ((dest != null)
                    && ((name != null)
                    || (name.length() > 0))) {

                endpoint = _consumers.getConsumerEndpoint(name);
                if ((endpoint != null)
                        && (endpoint.getDestination().equals(dest))) {
                    // retrieve the number of handles for the endpoint, which
                    // reflects the number of messages
                    count = endpoint.getMessageCount();
                } else {
                    // there is no cache with this name stored in memory. If
                    // this is an administered destination then read the count
                    //  directly from the database.
                    if (dest.getPersistent()) {
View Full Code Here

     * @return boolean             true if successful
     */
    public boolean unregisterConsumer(String name) {
        boolean success = false;

        ConsumerEndpoint endpoint = _consumers.getConsumerEndpoint(name);
        if (endpoint != null) {
            _consumers.closeConsumer(endpoint);
        }
        success = true;

View Full Code Here

     * @param name The name of the onsumer.
     * @return boolean True if the consumer is connected.
     */
    public boolean isConnected(String name) {
        boolean result = false;
        ConsumerEndpoint endpoint = _consumers.getConsumerEndpoint(name);
        if (endpoint != null && endpoint instanceof DurableConsumerEndpoint) {
            result = ((DurableConsumerEndpoint) endpoint).isActive();
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.exolab.jms.messagemgr.ConsumerEndpoint

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.