How to protect methods in Java (overflow, etc.)
I have to write a "watchdog" in Java to ensure that threads do not take long to execute There is no problem with object initialization. I created a class that uses the reflection in the run () method to call watchdog and constructor
Threads are easy to stop, but how can I guarantee regular methods for objects? For example, I call the method of object, which executes an infinite loop. What would you do?
thank you
Solution
Object runs on a thread It may be the AWT event scheduler or any of its so - called schedulers Or it may be the main thread of the console application
They are no different from the thread using the new thread () call
I guess your watchdog needs to look at all threads in the virtual machine and look for threads with utilization > = a certain threshold
What code do you have so far?
rich