First of all, a couple points on the whole premise of the factories closing. In China there's often a giant difference between the law and reality; implementation is a huge challenge. For instance, in the city of Tangshan outside Beijing, locals told me some dirtier plants that had been told to cease operations kept producing at night.
For those that do close, it's unclear for how long. Many expect they'll reopen after the Olympics but it's no sure thing. The central government may take this opportunity to shutter the dirtier factories forever for long-term environmental purposes.
As for compensation, I'm no legal expert. But my sense is Chinese workers are often on their own and are often left high and dry by their employers. One worker in Tangshan told me at his steel mill workers make US$10 a day, but when while it's closed the company pays them a "compensation" of 70 cents per day. To put that in perspective, that can buy them a day of subsistence food.
The final point to make is most factory and construction workers in China are migrants. They leave their spouses and families behind in the countryside and go to the cities where the work is. Then they send remittance money back, similar to what immigrant workers in the U.S. often do. In China when work dries up, migrants often move to the next city or town, while their families back home cross their fingers and hope things work out.