Package org.apache.qpid.amqp_1_0.transport

Examples of org.apache.qpid.amqp_1_0.transport.Predicate


    @Override
    public final Message_1_0 convert(M message, VirtualHost vhost)
    {

        SectionEncoder sectionEncoder = new SectionEncoderImpl(_typeRegistry);
        return new Message_1_0(convertToStoredMessage(message, sectionEncoder));
    }
View Full Code Here


    @Override
    public final Message_1_0 convert(M message, VirtualHost vhost)
    {

        SectionEncoder sectionEncoder = new SectionEncoderImpl(_typeRegistry);
        return new Message_1_0(convertToStoredMessage(message, sectionEncoder));
    }
View Full Code Here

    protected abstract void run();


    public Connection newConnection() throws ConnectionException
    {
        Container container = getContainerName() == null ? new Container() : new Container(getContainerName());
        return getUsername() == null ? new Connection(getHost(), getPort(), null, null, _frameSize, container,
                                                      _remoteHost == null ? getHost() : _remoteHost, _useSSL,
                                                      0)
                                     : new Connection(getHost(), getPort(), getUsername(), getPassword(), _frameSize,
                                                      container, _remoteHost == null ? getHost() : _remoteHost, _useSSL,
View Full Code Here

            // already connected?
            if( _state == State.UNCONNECTED )
            {
                _state = State.STOPPED;

                Container container = _clientId == null ? new Container() : new Container(_clientId);
                // TODO - authentication, containerId, clientId, ssl?, etc
                try
                {
                    _conn = new org.apache.qpid.amqp_1_0.client.Connection(_host,
                            _port, _username, _password, container, _remoteHost, _ssl,
View Full Code Here

        return _conn;
    }

    public void awaitOpen() throws TimeoutException, InterruptedException
    {
        getEndpoint().waitUntil(new Predicate()
        {
            @Override
            public boolean isSatisfied()
            {
                return getEndpoint().isOpen() || getEndpoint().isClosed();
View Full Code Here

    {
        _conn.close();

        try
        {
            _conn.waitUntil(new Predicate()
            {
                @Override
                public boolean isSatisfied()
                {
                    return _conn.closedForInput();
View Full Code Here

        _endpoint.setLocalUnsettled(unsettled);
        _endpoint.attach();

        try
        {
            _endpoint.waitUntil(new Predicate()
            {

                @Override
                public boolean isSatisfied()
                {
                    return _endpoint.isAttached() || _endpoint.isDetached();
                }
            });
        }
        catch (TimeoutException e)
        {
            throw new ConnectionErrorException(AmqpError.INTERNAL_ERROR,"Timeout waiting for attach");
        }
        catch (InterruptedException e)
        {
            throw new ConnectionErrorException(AmqpError.INTERNAL_ERROR,"Interrupted while waiting for attach");
        }

        if(_endpoint.getSource() == null)
        {
            try
            {
                _endpoint.waitUntil(new Predicate()
                {
                    @Override
                    public boolean isSatisfied()
                    {
                        return _endpoint.isDetached();
View Full Code Here

        synchronized(_endpoint.getLock())
        {
            try
            {
                _endpoint.waitUntil(new Predicate()
                                    {
                                        @Override
                                        public boolean isSatisfied()
                                        {
                                            return _endpoint.isAttached() || _endpoint.isDetached();
View Full Code Here

        synchronized(lock)
        {

            try
            {
                _endpoint.waitUntil(new Predicate()
                                    {
                                        @Override
                                        public boolean isSatisfied()
                                        {
                                            return _endpoint.hasCreditToSend() || _endpoint.isDetached();
                                        }
                                    }, getCreditTimeout());
            }
            catch (InterruptedException e)
            {
                throw new TimeoutException("Interrupted while waiting for credit");
            }

            if(_endpoint.isDetached())
            {
                throw new LinkDetachedException(_error);
            }
            if(action != null)
            {
                _outcomeActions.put(message.getDeliveryTag(), action);
            }
            _endpoint.transfer(xfr);
        }

        if(_windowSize != 0)
        {
            try
            {
                _endpoint.waitUntil(new Predicate()
                                    {
                                        @Override
                                        public boolean isSatisfied()
                                        {
                                            return _endpoint.getUnsettledCount() < _windowSize;
View Full Code Here

        {
            long timeout = getUnsettledTimeout();

            try
            {
                _endpoint.waitUntil(new Predicate()
                {
                    @Override
                    public boolean isSatisfied()
                    {
                        return _endpoint.getUnsettledCount() == 0;
                    }
                }, timeout);
            }
            catch (InterruptedException e)
            {
                unsettledDeliveries = true;
            }
            catch (TimeoutException e)
            {
                unsettledDeliveries = true;
            }

        }
        _session.removeSender(this);
        _endpoint.setSource(null);
        _endpoint.close();
        _closed = true;

        try
        {
            _endpoint.waitUntil(new Predicate()
            {
                @Override
                public boolean isSatisfied()
                {
                    return _endpoint.isDetached();
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.transport.Predicate

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.