Sun has a working version, open sourced, dynamically linked, named Domain Specific Hibernation, that does that exactly, why do you think Oracle bought them?
Sergio