  We study the energy transfer by exact resonances for surface gravity waves in
a finite periodic spatial domain. Based on a kinematic model simulating the
generation of active wave modes in a finite discrete wavenumber space
$\mathcal{S}_R$, we examine the possibility of direct and inverse energy
cascades. More specifically, we set an initially excited region which
iteratively spreads energy to wave modes in $\mathcal{S}_R$ through exact
resonances. At each iteration, we first activate new modes from scale
resonances (which generate modes with new lengths), then consider two bounding
situations for angle resonances (which transfer energy at the same length
scale): the lower bound where no angle resonance is included and the upper
bound where all modes with the same length as any active mode are excited. Such
a strategy is essential to enable the computation for a large domain
$\mathcal{S}_R$ with the maximum wavenumber $R\sim 10^3$. We show that for both
direct and inverse cascades, the energy cascade to the boundaries of
$\mathcal{S}_R$ can be established when the initially excited region is
sufficiently large, otherwise a frozen turbulence state occurs, with a sharp
transition between the two regimes especially for the direct cascade. Through a
study on the structure of resonant quartets, the mechanism associated with the
sharp transition and the role of angular energy transfer in the cascades are
elucidated.
