{
checkClosed();
checkValidDestination(destination);
if(destination instanceof TemporaryDestination)
{
TemporaryDestination temporaryDestination = (TemporaryDestination) destination;
if(temporaryDestination.getSession() != this)
{
throw new JMSException("Cannot consume from a temporary destination created on another session");
}
if(temporaryDestination.isDeleted())
{
throw new IllegalStateException("Destination is deleted");
}
}
final MessageConsumerImpl messageConsumer;