  We address the properties of optical solitons in thermal nonlinear media with
a local refractive index defect that is capable to trap solitons launched even
close to the sample boundary despite the boundary-mediated forces that tend to
deflect all beams toward the center of the sample. We show that while such
forces become more pronounced with increasing the input beam power the defect
can trap only light below a critical power above which solitons are ejected.
The dynamics of soliton ejection and the subsequent propagation may be
controlled.
