Capture and confinement of solitons in nonlinear integrable systems