1

I need to serialize a Java Process (to persistent storage such as a disk) followed by killing it.

Then at a later time De-serialize it and re-resurrect it at a later date.

Constraints:

  1. I already have a set of process that I want to add this feature to.
  2. I am therefore looking for a solution that is minimally invasive.
  3. The processes have code that will re-establish connections to resources such as sockets, DBs etc.
  4. What I need to do is persist the thread statuses, variables, objects, etc.

NOTE:

  1. I have decent knowledge of the issues surrounding the serializing of an Object Graph.
  2. Many years ago I'd conceptually figured out how to do this using AspectJ but I can't find my notes
  3. This question pertains to Java Process only -- so the solution would work on say a JVM running on OSX, Linux, or Windows
  4. The process in question would be refactor-able to achieve this functionality.
4

2 に答える 2

2

一般的な方法で Java だけを使用してこれを行うことはできません。仮想マシンで JVM を実行できます。仮想マシンは、必要に応じて停止し、ディスクに保存して再起動できます。ネットワーク接続を再確立する必要があることに注意してください。相手側はソケットがなくなったことを確認するため、透過的に復元できる方法でそれらを永続化する方法はありません。

于 2012-08-18T07:57:51.413 に答える