Package org.exolab.jms.messagemgr

Examples of org.exolab.jms.messagemgr.Condition


     * @return the next message or <code>null</code> if none is available
     * @throws JMSException for any JMS error
     */
    public MessageImpl receive(long consumerId, long wait) throws JMSException {
        MessageImpl result = null;
        Condition condition;
        if (wait > 0) {
            condition = TimedCondition.before(wait);
        } else {
            condition = new Flag(true);
        }
View Full Code Here


    /**
     * Send messages to the client.
     */
    private void dispatch() {
        final Condition timeout = TimedCondition.after(30 * 1000);
        Condition done = new Condition() {
            public boolean get() {
                return _stop.get() || timeout.get();
            }
        };

        _log.debug("dispatch");
        int sent = 0;
        while (sent < MAX_MESSAGES && !done.get()) {
            ConsumerEndpoint consumer;
            synchronized (_pending) {
                if (!_pending.isEmpty()) {
                    consumer = (ConsumerEndpoint) _pending.removeFirst();
                } else {
View Full Code Here

    private MessageImpl doReceive(long consumerId, final Condition wait)
            throws JMSException {
        ConsumerEndpoint consumer = getConsumer(consumerId);

        Condition cancel;
        if (wait != null) {
            cancel = new Condition() {
                public boolean get() {
                    return _stop.get() || !wait.get();
                }
            };
        } else {
View Full Code Here

TOP

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

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.