The poem begins with a strange wish: to live like a lock, "exact and satisfied." A lock is precise, closed off, and complete in itself. The speaker pictures it as a delicate mechanism sitting in a grotto, a hidden, sheltered place. At first this sounds almost like contentment, a life of order and self-sufficiency.
Then the tone shifts at "but." Living this way means giving up "light dancing on the sea," the openness and movement of the world outside. The last two lines turn the idea around. The sea doesn't vanish; it keeps "rocking at a distance / in every body." Judging by the imagery, the speaker suggests that even someone who shuts themselves away still carries the pull of the sea inside, perhaps as feeling, desire, or the body's own rhythms. The mood is quiet and wistful, with a sense that isolation can feel neat and safe but leaves a longing it cannot fully shut out.