Results 1 to 8 of 8
- 08-29-2011, 09:32 AM #1
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 08-29-2011, 02:15 PM #2
Are you asking about how to loop back to the first instruction?
If you want to exit a JVM and start a new JVM that is a bit tricky. There would need to be another program outside of the JVM that would get control while your original JVM exits and then this other program would start a new JVM with your program again later.
What is the problem you are trying to solve?
- 08-30-2011, 10:12 AM #3
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
I have 2 machines, A and B both have windows services which invoke my java program via JNI. At any point, only one instance of the program is running and the other acts as a failover mechanism, i.e. when A fails perhaps due to a hardware fault, machine B takes would detect this and start up its instance of the java program.
Problem is that when B starts up its instance of the java program, it would start it at the statement where A originally crashed, not at the beginning and as a result, some variables are not initialized properly as there is no way of transferring the state from A to B. What I would like to do is to reinitialize the JVM on machine B such that it starts all over again at the beginning with the correct env variables as if I had just invoked the program from scratch.
I can't create a new process through process builder as this would sever the link between the new process and windows services. Any ideas?
- 08-30-2011, 01:35 PM #4
How does B know where A "crashed"? How does it skip over the initialization code to get to that point?Problem is that when B starts up its instance of the java program, it would start it at the statement where A originally crashed, not at the beginning
How do the two PCs communicated?
Can your code be run from a batch file that has a loop? When a program wants to "restart" it exits and the batch file loops and restarts the program.What I would like to do is to reinitialize the JVM on machine B such that it starts all over again at the beginning
- 08-30-2011, 01:44 PM #5
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 08-30-2011, 01:50 PM #6
Is the program told it should reinitialize itself?best if the java program can reinitialize itself
Then it should be rewritten to do that when it is directed to.
What is the program doing while it is waiting for its turn to take over?
Is it sleeping or looping?
What if no initialization is done until it gets the message it is to take over.
- 08-30-2011, 02:39 PM #7
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
the program is a windows service in the stop state when it is not running, when the program on the other side crashes, the program is started at the exact same statement before the crash on the other side
is there a way to reinitialize the jvm and make it run from the first statement instead?
- 08-30-2011, 02:45 PM #8
This sounds like it is mostly about using a feature of the OS.a way to reinitialize the jvm and make it run from the first statement instead
What program starts the stopped program? Can the stopped program detect that it has been stopped?
Can the stopped program be stopped at the point that you want it to start from?
Similar Threads
-
Programmatically starting cell editing in JTable
By javaexplorer in forum AWT / SwingReplies: 2Last Post: 05-21-2010, 04:33 PM -
Programmatically configuring Log4J Logger while leaving config alone
By Hichhiker in forum Advanced JavaReplies: 0Last Post: 05-19-2010, 09:44 PM -
Logging a specific package in log4j programmatically
By vintem in forum New To JavaReplies: 0Last Post: 05-13-2010, 07:03 PM -
How to make program restart without writing java programname, again.
By TheBeed in forum New To JavaReplies: 6Last Post: 11-04-2009, 09:41 PM -
Close a JDialog Programmatically
By Marcus in forum Advanced JavaReplies: 1Last Post: 07-06-2007, 04:06 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks