Javaflow 继续:尝试保存静态变量
我一直在尝试使用 Javaflow 创建一些检查点解决方案。它适用于所有局部变量。但它无法保存静态变量实例。我正在尝试做这样的事情:
foo( ){
//Doing Something
//Writing the static variable value, suppose
MyClass.StaticValue=10;
Continuation.suspend( ); //Checkpoint P created
//Do Something
//Update the static value, suppose
MyClass.StaticValue=11;
return;
}
现在,当我尝试从 checkPoint P 恢复时,我期望将 StaticValue 读取为 10,但它是 11。我对此有两个问题:
- 这是预期的吗? Javaflow 的行为还是我在使用 Javaflow 时遗漏了某些内容?
- 除了使用某些版本控制并存储所有静态变量之外,是否有一种聪明的方法来存储这些静态变量。
I had been trying to create some check-pointing solutions using Javaflow . It works well with all the local variable. But it is unable to save the static variable instance. I am trying to do something like this:
foo( ){
//Doing Something
//Writing the static variable value, suppose
MyClass.StaticValue=10;
Continuation.suspend( ); //Checkpoint P created
//Do Something
//Update the static value, suppose
MyClass.StaticValue=11;
return;
}
Now when i try to restore back from checkPoint P, I expect to read the StaticValue as 10, but it is 11. I have two questions regarding it:
- Is it a expected behavior from Javaflow or I am missing something while using Javaflow?
- Is there a smart way to store these static variable other than using some versioning and storing all of them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了答案:
1. Javaflow不支持静态变量检查点。
2. 只有版本控制看起来像是一个方向。
I think I found my answer:
1. Javaflow don't support static variables check-pointing.
2. Only versioning looks like a direction.