John was sleeping when I walked in. At the moment of the action "I walked in", John was seen to be asleep.
Here there is no information about how long John slept, so there's nothing here involving duration or temporariness, except insofar as we know (outside of language) that sleeping takes some finite amount of time and does not last forever. What was noticed was the part of the sleeping that was "in midstream", i.e., neither the beginning (falling asleep) nor the ending (waking).
John had been sleeping when I walked in. At the moment of the action "I walked in", something was noticed which indicated that either "John was actually asleep" or "John, though awake, looked as if he had just woken from sleep". Here, what was noticed might have been either the sleeping "in midstream" or the later effects (after waking).
John is sleeping now. At the moment of the utterance, John is seen to be asleep.
Here there is again no information about how long John has been sleeping or how long he will continue to sleep, so there's nothing here involving duration or temporariness, except insofar as we know (outside of language) that sleeping takes time and does not last forever. Again, the sleeping is "in midstream" when it is noticed.
John has been sleeping since morning. At the moment of the utterance, it is known that John went to sleep earlier (during the morning of this day) and has continued to sleep without interruption until the moment of the utterance. Here the relative duration is specified. The sleeping is "in midstream" and there is some knowledge communicated about when the sleep episode began (morning).
CJ