Geometric Optics and Boundary Layers for Nonlinear-Schrödinger Equations