CMB is a unique airport. There is a "transit desk" in the area before you go to immigration, they take your passports and retrieve boarding passes from your connecting airline (this assumes no checked luggage, but oddly enough I seem to recall that I've done it before with checked luggage and they handled it, though that was CA to KE <yes, KE had rights from CMB-MLE as 5th freedom>).
Like a few other airports in SEA, CMB puts all incoming and outgoing passengers into the same transit hall. Outbound passengers do security at the gate, same as SIN and KUL. Inbound passengers either go to their next gate (if in transit) or to immigration to stay in Sri Lanka. There's even a transit hotel inside the "transit" area.