简体   繁体   中英

Control running Java SE program remotely

I wrote Java SE program which has deal with really huge dataset of matrices(10^12 matrices). I am generating them through iterator and saving special ones (which satisfy some criteria) either to Java heap or database. So, I understand that it's gonna take a lot of time (probably a few days). In order to operate with all this stuff I decided to run the program on computer which is not at my apartment and has access to the Internet. I want to control runnig process of the program (for me is very important to know is everything OK with the program? Is the program still running?)

My question is how to control that my program is still running (for this purpose I want to use computer at my appartment and the Internet)?

Maybe my program should periodically post (via Java IO API ) messages to websites ( Google Docs and so on). Thanks in advance for all your responses.

Run your application with JPDA enabled. This way you can connect it remotely, examine threads, etc.

JPDA has a number of other advantages as well, for example hot code replace.

Specification for JPDA is here, the most important is that you have to pass a few JVM options on startup, it will open a port, and you can use Eclipse or NetBeans to attach it from anywhere on the net. You have to make sure that the opened port is accessible through firewalls (local and network).

First you should try a remote desktop connection. Here's link to MS documents for Windows 7 remote desktop .

If the remote computer is Linux/Unix, and your program is console application, ssh+screen is the old, true and tested solution to leave interactive console programs running and accessible from anywhere, while you frolic in the real world.

I would go for VisualVM & remote JMX. Setup the server box to allow remote jmx connections. With VisualVM you'll be able to connect to the JVM and check the activity.

You can also set up MBeans to keep stats of the running process. Which you'll be able to check also with VisualVM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM