The line "the Sun was shining on the sea" primarily employs personification. This is because the sun is attributed action (shining) in a way that gives it a life-like quality, as though it is intentionally shining upon the sea. While it describes a natural phenomenon, it can be interpreted as imbuing the sun with a sense of agency.
However, it's worth noting that the line itself is quite literal and doesn’t heavily lean into figurative language. It simply conveys the imagery of sunlight reflecting on the sea. If you're looking for a more figurative or expressive usage, context would matter more in determining how this line fits into a larger work.