public void addChannel(AMQChannel channel) throws AMQException
{
if (_closed)
{
throw new AMQException("Session is closed");
}
final int channelId = channel.getChannelId();
if (_closingChannelsList.containsKey(channelId))
{
throw new AMQException("Session is marked awaiting channel close");
}
if (_channelMap.size() == _maxNoOfChannels)
{
String errorMessage =
toString() + ": maximum number of channels has been reached (" + _maxNoOfChannels
+ "); can't create channel";
_logger.error(errorMessage);
throw new AMQException(AMQConstant.NOT_ALLOWED, errorMessage);
}
else
{
synchronized (_channelMap)
{