}
private void frameReceived(AMQFrame frame) throws AMQException
{
int channelId = frame.getChannel();
AMQBody body = frame.getBodyFrame();
//Look up the Channel's Actor and set that as the current actor
// If that is not available then we can use the ConnectionActor
// that is associated with this AMQMPSession.
LogActor channelActor = null;
if (_channelMap.get(channelId) != null)
{
channelActor = _channelMap.get(channelId).getLogActor();
}
CurrentActor.set(channelActor == null ? _actor : channelActor);
try
{
if (_logger.isDebugEnabled())
{
_logger.debug("Frame Received: " + frame);
}
// Check that this channel is not closing
if (channelAwaitingClosure(channelId))
{
if ((frame.getBodyFrame() instanceof ChannelCloseOkBody))
{
if (_logger.isInfoEnabled())
{
_logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
}
}
else
{
// The channel has been told to close, we don't process any more frames until
// it's closed.
return;
}
}
try
{
body.handle(channelId, this);
}
catch (AMQException e)
{
closeChannel(channelId);
throw e;