public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
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()));
String host = protocolSession.getAMQConnection().getVirtualHost();
AMQShortString virtualHost = new AMQShortString("/" + host);
protocolSession.writeFrame(createConnectionOpenFrame(evt.getChannelId(), virtualHost, null, true, frame.getMajor(),
frame.getMinor()));
}