  We study the structure of $D$-modules over a ring $R$ which is a direct
summand of a polynomial or a power series ring $S$ with coefficients over a
field. We relate properties of $D$-modules over $R$ to $D$-modules over $S$. We
show that the localization $R_f$ and the local cohomology module $H^i_I(R)$
have finite length as $D$-modules over $R$. Furthermore, we show the existence
of the Bernstein-Sato polynomial for elements in $R$. In positive
characteristic, we use this relation between $D$-modules over $R$ and $S$ to
show that the set of $F$-jumping numbers of an ideal $I\subseteq R$ is
contained in the set of $F$-jumping numbers of its extension in $S$. As a
consequence, the $F$-jumping numbers of $I$ in $R$ form a discrete set of
rational numbers. We also relate the Bernstein-Sato polynomial in $R$ with the
$F$-thresholds and the $F$-jumping numbers in $R$.
