I have java program (with a gui) which is running on a host. On runtime a user can add some data records. The program just works with them.
Later the system maybe shuts down or the program is just closed by SIGTERM.
Unfortunately the porgram only seems to store the data records if it is closed manually by the user with the "X".
Now i have the problem that i maybe lose some data if the program is closed by SIGTERM. Unfortunately there is no contact email address to ask the author for the change.
I tried to decompile it with "jd gui" which seemed to work more or less. I thought then i just could add the signal handler and invoke the "window close" method.
But "jd gui" created code like this:
/* 110:269 */ if ((??? = Thread.currentThread().getContextClassLoader()) != null) {
/* 111:270 */ return ???;
And i also get many other errors if i try to compile the source.
I think this is because the jar file is obfuscated by some tool. Unfortunately the decompiled code doesn't work and i am not able to recompile the file with the JFrame.
Long story short: Is it possible to write a "wrapper program" which just handles SIGTERM and then invokes the JFrame "close method" (or how it is called) of the main frame (which is the only JFrame)?
I just do not know how to invoke such a method of an external running java program.
Thank you very much.
Best regards Kevin