Dumping a Java program into a file and restarting it

后端 未结 10 979
温柔的废话
温柔的废话 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条回答
  •  -上瘾入骨i
    2020-12-29 08:39

    How about using SpringBatch framework?

    As far as I understood from your question you need some reliable and resumable java task, if so, I believe that Spring Batch will do the magic, because you can split your task (job) to several steps while each step (and also the entire job) has its own execution context persisted to a storage you choose to work with.

    In case of crash you can recover by analyzing previous run of specific job and resume it from exact point where the failure occurred.

    You can also pause and restart your job programmatically if the job was configured as restartable and the ExecutionContext for this job already exists.

    Good luck!

提交回复
热议问题