  In this communication we study the behaviour of spin current components in a
ballistic junction consisting of two semi-infinite leads and a scattering
region composed of two magnetic layers separated by a non-magnetic metallic
spacer. We then consider the system being gradually isolated from the leads,
which we refer to as the transition from an open to a closed regime. As
expected on physical grounds, charge and in-plane components vanish, but the
out-of-plane spin current remains finite and gives rise to the oscillatory
interlayer exchange coupling (IEC) between the magnets. We show that the
out-of-plane spin current reduces to a set of peaks in momentum space, which
correspond to discrete energy eigenstates of the closed system. Furthermore, we
demonstrate that the expression for the IEC in terms of spin current for an
open system reduces to an expression in the closed system, which corresponds
exactly to the definition of IEC in terms of energy difference.
