Fetching details from the dictionary...
to shut oneself in (one's house, room, etc.); to confine oneself (to)
to barricade oneself (in a building); to entrench oneself; to hole up; to hold (a castle, etc.)
彼は自分の部屋に立て篭った。
He shut himself in his room.
彼女は立て篭って考え事をしている。
She has shut herself in to think.
危険を感じて家に立て篭る。
Feeling danger, I shut myself in at home.