Dumping a Java program into a file and restarting it

后端 未结 10 1010
温柔的废话
温柔的废话 2020-12-29 08:30

I was just wondering if it\'s possible to dump a running Java program into a file, and later on restart it (same machine)

It\'s sounds a bit weird, but who knows

10条回答
  •  误落风尘
    2020-12-29 08:44

    Probably Terracotta can this: http://www.terracotta.org

    I am not sure but they are supporting server failures. If all servers stop, the process should saved to disk and wait I think.

    Otherwise you should refactor your application to hold state explicitly. For example, if you implement something like runnable and make it Serializable, you will be able to save it.

提交回复
热议问题