1. class A have some methods executed sequentialy within an infinite loop,
2.class B have some logic to check Class A programme is running or not in every 2 minutes, if class A programme is not running then start it,
please suggest me a way to implement both class A & class B.
>> How can i check class A is running or not?
>> How can i start class A execution from Class B ?
>> How can i schedule running of Class B application in every 2 mins in a windows environment?
>> How can i implement a infinte java loop ,with out stack over flow.
Honestly, there are often better ways than polling a process every so often. Instead, why don't you wait for the process to notify you of when it's done?
Joined: Mar 28, 2010
Actually , it is a real time system,
the first class have a infinite loop and continuously executed some method , second class is only care taker of first class and their is no other relation ship like parent -child (inheritance),
So second class (Class B) only ensure that Class A loop and methods are in execution, when class get crashed or its execution stops class B restart Class A.
I also have to ensure that Class A have only one process running ,
no further process is created of class A in any condition.