Package org.apache.qpid.client

Examples of org.apache.qpid.client.ConnectionTuneParameters


    public void methodReceived(AMQProtocolSession session, ConnectionTuneBody frame, int channelId)
    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();

        ConnectionTuneParameters params = session.getConnectionTuneParameters();

        int maxChannelNumber = frame.getChannelMax();
        //0 implies no limit, except that forced by protocol limitations (0xFFFF)
        params.setChannelMax(maxChannelNumber == 0 ? AMQProtocolSession.MAX_CHANNEL_MAX : maxChannelNumber);
        params.setFrameMax(frame.getFrameMax());

        //if the heart beat delay hasn't been configured, we use the broker-supplied value
        if (params.getHeartbeat() == null)
        {
            params.setHeartbeat(frame.getHeartbeat());
        }

        session.tuneConnection(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here


        return _connectionTuneParameters;
    }

    private void initialiseTuneParameters(ConnectionSettings settings)
    {
        _connectionTuneParameters = new ConnectionTuneParameters();
        _connectionTuneParameters.setHeartbeat(settings.getHeartbeatInterval08());
        _connectionTuneParameters.setHeartbeatTimeoutFactor(settings.getHeartbeatTimeoutFactor());
    }
View Full Code Here

        throws AMQException
    {
        _logger.debug("ConnectionTune frame received");
        ConnectionTuneBody frame = (ConnectionTuneBody) evt.getMethod();

        ConnectionTuneParameters params = protocolSession.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }

        params.setFrameMax(frame.frameMax);
        params.setChannelMax(frame.channelMax);
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.heartbeat));
        protocolSession.setConnectionTuneParameters(params);

        stateManager.changeState(AMQState.CONNECTION_NOT_OPENED);
        protocolSession.writeFrame(createTuneOkFrame(evt.getChannelId(), params, frame.getMajor(), frame.getMinor()));
View Full Code Here

    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();


        ConnectionTuneParameters params = session.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }
       
        int maxChannelNumber = frame.getChannelMax();
        //0 implies no limit, except that forced by protocol limitations (0xFFFF)
        params.setChannelMax(maxChannelNumber == 0 ? AMQProtocolSession.MAX_CHANNEL_MAX : maxChannelNumber);

        params.setFrameMax(frame.getFrameMax());
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.getHeartbeat()));
        session.setConnectionTuneParameters(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here

    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();


        ConnectionTuneParameters params = session.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }
       
        int maxChannelNumber = frame.getChannelMax();
        //0 implies no limit, except that forced by protocol limitations (0xFFFF)
        params.setChannelMax(maxChannelNumber == 0 ? AMQProtocolSession.MAX_CHANNEL_MAX : maxChannelNumber);

        params.setFrameMax(frame.getFrameMax());
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.getHeartbeat()));
        session.setConnectionTuneParameters(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here

    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();


        ConnectionTuneParameters params = session.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }

        params.setFrameMax(frame.getFrameMax());
        params.setChannelMax(frame.getChannelMax());
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.getHeartbeat()));
        session.setConnectionTuneParameters(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here

    {
        _logger.debug("ConnectionTune frame received");
        ConnectionTuneBody frame = (ConnectionTuneBody) evt.getMethod();
        AMQProtocolSession session = evt.getProtocolSession();

        ConnectionTuneParameters params = session.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }

        params.setFrameMax(frame.frameMax);       
        params.setChannelMax(frame.channelMax);
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.heartbeat));
        session.setConnectionTuneParameters(params);

        stateManager.changeState(AMQState.CONNECTION_NOT_OPENED);
        session.writeFrame(createTuneOkFrame(evt.getChannelId(), params));
        session.writeFrame(createConnectionOpenFrame(evt.getChannelId(), session.getAMQConnection().getVirtualHost(), null, true));
View Full Code Here

        return _connectionTuneParameters;
    }

    private void initialiseTuneParameters(ConnectionSettings settings)
    {
        _connectionTuneParameters = new ConnectionTuneParameters();
        _connectionTuneParameters.setHeartbeat(settings.getHeartbeatInterval08());
        _connectionTuneParameters.setHeartbeatTimeoutFactor(settings.getHeartbeatTimeoutFactor());
    }
View Full Code Here

    public void methodReceived(AMQProtocolSession session, ConnectionTuneBody frame, int channelId)
    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();

        ConnectionTuneParameters params = session.getConnectionTuneParameters();

        int maxChannelNumber = frame.getChannelMax();
        //0 implies no limit, except that forced by protocol limitations (0xFFFF)
        params.setChannelMax(maxChannelNumber == 0 ? AMQProtocolSession.MAX_CHANNEL_MAX : maxChannelNumber);
        params.setFrameMax(frame.getFrameMax());

        //if the heart beat delay hasn't been configured, we use the broker-supplied value
        if (params.getHeartbeat() == null)
        {
            params.setHeartbeat(frame.getHeartbeat());
        }

        session.tuneConnection(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());

        session.setMaxFrameSize(params.getFrameMax());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here

    {
        _logger.debug("ConnectionTune frame received");
        final MethodRegistry methodRegistry = session.getMethodRegistry();


        ConnectionTuneParameters params = session.getConnectionTuneParameters();
        if (params == null)
        {
            params = new ConnectionTuneParameters();
        }

        params.setFrameMax(frame.getFrameMax());
        params.setChannelMax(frame.getChannelMax());
        params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.getHeartbeat()));
        session.setConnectionTuneParameters(params);

        session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);

        ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
                                                                                    params.getFrameMax(),
                                                                                    params.getHeartbeat());
        // Be aware of possible changes to parameter order as versions change.
        session.writeFrame(tuneOkBody.generateFrame(channelId));

        String host = session.getAMQConnection().getVirtualHost();
        AMQShortString virtualHost = new AMQShortString("/" + host);
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.ConnectionTuneParameters

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.