Package org.apache.qpid.amqp_1_0.type.transport

Examples of org.apache.qpid.amqp_1_0.type.transport.Error


        {
            return in.getFloat();
        }
        else
        {
            org.apache.qpid.amqp_1_0.type.transport.Error error = new Error();
            error.setCondition(ConnectionError.FRAMING_ERROR);
            error.setDescription("Cannot construct float: insufficient input data");
            throw new AmqpErrorException(error);
        }
    }
View Full Code Here


        _connectionEventListener.closeReceived();
        switch (_state)
        {
            case UNOPENED:
            case AWAITING_OPEN:
                Error error = new Error();
                error.setCondition(ConnectionError.CONNECTION_FORCED);
                error.setDescription("Connection close sent before connection was opened");
                connectionError(error);
                break;
            case OPEN:
                _state = ConnectionState.CLOSE_RECEIVED;
                sendClose(new Close());
View Full Code Here

            {
                endpoint = _sendingSessions[myChannelId];
            }
            catch (IndexOutOfBoundsException e)
            {
                final Error error = new Error();
                error.setCondition(ConnectionError.FRAMING_ERROR);
                error.setDescription("BEGIN received on channel " + channel + " with given remote-channel "
                                     + begin.getRemoteChannel() + " which is outside the valid range of 0 to "
                                     + _channelMax + ".");
                connectionError(error);
                return;
            }
            if (endpoint != null)
            {
                if (_receivingSessions[channel] == null)
                {
                    _receivingSessions[channel] = endpoint;
                    endpoint.setReceivingChannel(channel);
                    endpoint.setNextIncomingId(begin.getNextOutgoingId());
                    endpoint.setOutgoingSessionCredit(begin.getIncomingWindow());
                }
                else
                {
                    final Error error = new Error();
                    error.setCondition(ConnectionError.FRAMING_ERROR);
                    error.setDescription("BEGIN received on channel " + channel + " which is already in use.");
                    connectionError(error);
                }
            }
            else
            {
                final Error error = new Error();
                error.setCondition(ConnectionError.FRAMING_ERROR);
                error.setDescription("BEGIN received on channel " + channel + " with given remote-channel "
                                     + begin.getRemoteChannel() + " which is not known as a begun session.");
                connectionError(error);
            }


        }
        else // Peer requesting session creation
        {

            myChannelId = getFirstFreeChannel();
            if (myChannelId == -1)
            {
                // close any half open channel
                myChannelId = getFirstFreeChannel();

            }

            if (_receivingSessions[channel] == null)
            {
                SessionEndpoint endpoint = new SessionEndpoint(this, begin);

                _receivingSessions[channel] = endpoint;
                _sendingSessions[myChannelId] = endpoint;

                Begin beginToSend = new Begin();

                endpoint.setReceivingChannel(channel);
                endpoint.setSendingChannel(myChannelId);
                beginToSend.setRemoteChannel(UnsignedShort.valueOf(channel));
                beginToSend.setNextOutgoingId(endpoint.getNextOutgoingId());
                beginToSend.setOutgoingWindow(endpoint.getOutgoingWindowSize());
                beginToSend.setIncomingWindow(endpoint.getIncomingWindowSize());
                send(myChannelId, beginToSend);

                _connectionEventListener.remoteSessionCreation(endpoint);
            }
            else
            {
                final Error error = new Error();
                error.setCondition(ConnectionError.FRAMING_ERROR);
                error.setDescription("BEGIN received on channel " + channel + " which is already in use.");
                connectionError(error);
            }

        }
View Full Code Here

            long lsb = in.getLong();
            return new UUID(msb, lsb);
        }
        else
        {
            org.apache.qpid.amqp_1_0.type.transport.Error error = new Error();
            error.setCondition(ConnectionError.FRAMING_ERROR);
            error.setDescription("Cannot construct UUID: insufficient input data");
            throw new AmqpErrorException(error);

        }
    }
View Full Code Here

                    catch (JMSException e)
                    {
                    }
                    try
                    {
                        final Error error = end.getError();
                        final ExceptionListener exceptionListener = _connection.getExceptionListener();
                        if(exceptionListener != null)
                        {
                            if(error != null)
                            {
                                exceptionListener.onException(new JMSException(error.getDescription(),
                                        error.getCondition().getValue().toString()));
                            }
                            else
                            {
                                exceptionListener.onException(new JMSException("Session remotely closed"));
                            }
View Full Code Here

                return session;
            }
            catch(JMSException e)
            {
                Error remoteError;
                if(started
                   && e.getLinkedException() instanceof ConnectionErrorException
                   && (remoteError = ((ConnectionErrorException)e.getLinkedException()).getRemoteError()).getCondition() == ConnectionError.REDIRECT)
                {
                    String networkHost = (String) remoteError.getInfo().get(Symbol.valueOf("network-host"));
                    int port = (Integer) remoteError.getInfo().get(Symbol.valueOf("port"));
                    String hostName = (String) remoteError.getInfo().get(Symbol.valueOf("hostname"));
                    reconnect(networkHost,port,hostName);
                    return createSession(acknowledgeMode);

                }
                else
View Full Code Here

                {
                    final ExceptionListener exceptionListener = _session.getConnection().getExceptionListener();

                    if(exceptionListener != null)
                    {
                        final Error receiverError = _receiver.getError();
                        exceptionListener.onException(new JMSException(receiverError.getDescription(),
                                receiverError.getCondition().getValue().toString()));

                    }
                }
                catch (JMSException e)
                {
View Full Code Here

            return _session.getClientSession().createReceiver(_session.toAddress(_destination), AcknowledgeMode.ALO,
                    _linkName, _durable, getFilters(), null);
        }
        catch (ConnectionErrorException e)
        {
            Error error = e.getRemoteError();
            if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
            {
                throw new InvalidSelectorException(e.getMessage());
            }
            else
            {
                throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());

            }
        }
    }
View Full Code Here

        return createJMSMessage(msg, redelivery);
    }

    void checkReceiverError() throws JMSException
    {
        final Error receiverError = _receiver.getError();
        if(receiverError != null)
        {
            JMSException jmsException =
                    new JMSException(receiverError.getDescription(), receiverError.getCondition().toString());

            throw jmsException;
        }
    }
View Full Code Here

        else
        {

            try
            {
                final Error err = new Error();
                err.setCondition(AmqpError.INTERNAL_ERROR);
                err.setDescription(throwable.getMessage());
                _endpoint.close(err);
                close();
            }
            catch(TransportException e)
            {
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.type.transport.Error

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.